Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New text entities in KET-format #1970

Open
even1024 opened this issue May 26, 2024 · 1 comment · May be fixed by #2093
Open

New text entities in KET-format #1970

even1024 opened this issue May 26, 2024 · 1 comment · May be fixed by #2093
Assignees

Comments

@even1024
Copy link
Collaborator

even1024 commented May 26, 2024

Background
Current implementation has a lack of text formatting features implemented in other chemical formats (CDX/CDXML).
Mostly it's related to paragraph-formatting features: indents, and left-center-right layouts.

Here is an example of new text entity in KET:

{
    "type": "text",
    "bounding_box": {
        "x": 0,
        "y": 0,
        "width": 320,
        "height": 200
    },
    "alignment": "center",
    "indent": {
        "left": 10,
        "right": 10,
        "first_line": 20
     },
     "font":{
        "family": "Arial",
        "size": 18,
        "color": "#000000"
    }
    "italic": true
    "paragraphs": [
        {
             "alignment": "center",
             "indent": {
                "left": 10,
                "right": 10,
                "first_line": 20
             },
             "font":{
                  "color": "red",
             },
             "underline": true
             "parts": [
                 {
                     "text": "The quick brown "
                 },
                 {
                    "text": "fox jumps"
                    "font": {
                        "size": 22
                     },
                     "bold": true,
                     "italic": false,
                     "superscript": true
                 },
                 {
                      "text": " over the lazy dog"
                      "italic": false,
                 },
             ],
        },
        {
             "alignment": "left",
             "indent": {
                "left": 10,
             },
              "parts": [
                  {
                      "text": "Sphinx of black quartz, judge my vow."
                  }
              ]
        },
        {
             "alignment": "left",
             "indent": {
                "left": 10,
             },
             "parts": [
                 {
                     "text": "H"
                 },
             "parts": [
                 {
                     "text": "2"
                     "subscript": true,
                 },
              "parts": [
                 {
                     "text": "O"
                 }
              ]
        }
      ]
}

Since this change is not backwards compatible, version 2.0 of the KET format is being introduced with ket_version field:

{
    "ket_version" : "2.0.0",
    "root": {
    }
}

Also, a new Indigo "ket-saving-version" option is being added to Indigo API. This option is a string value in the format: "major_version.minor_version". For example if ketcher expects Indigo response in KET-format, the option should be added into request. The same approach is already implemented with mol-format and corresponding "molfile-saving-mode" option.

Alternatives
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@AlexeyGirin
Copy link
Collaborator

Moved to 1.22 rc1 as agreed on the meeting

@even1024 even1024 added this to Indigo Mar 18, 2025
@github-project-automation github-project-automation bot moved this to Product Backlog in Indigo Mar 18, 2025
@even1024 even1024 added this to the Indigo-1.31.0-rc.1 (Current) milestone Mar 18, 2025
@even1024 even1024 linked a pull request Mar 18, 2025 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Product Backlog
Development

Successfully merging a pull request may close this issue.

2 participants