-
Notifications
You must be signed in to change notification settings - Fork 104
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
#1970 - New text entities in KET-format #2093
base: master
Are you sure you want to change the base?
Conversation
@@ -71,10 +71,38 @@ void printMappings(Array<int>& mapping) | |||
} | |||
|
|||
MoleculeJsonSaver::MoleculeJsonSaver(Output& output) | |||
: _output(output), _pmol(nullptr), _pqmol(nullptr), add_stereo_desc(false), pretty_json(false), use_native_precision(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by default ket version 1 should be used in json saver
writer.EndObject(); | ||
} | ||
|
||
void MoleculeJsonSaver::saveText(JsonWriter& writer, const KETTextObject& text_obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to saveTextV2
@@ -639,6 +661,47 @@ void MoleculeCdxmlLoader::_parseCDXMLPage(BaseCDXElement& elem) | |||
_has_scheme = true; | |||
} | |||
} | |||
else if (page_elem->value() == "colortable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add constant for colortable
{ | ||
for (auto color_elem = page_elem->firstChildElement(); color_elem->hasContent(); color_elem = color_elem->nextSiblingElement()) | ||
{ | ||
if (color_elem->name() == "color") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add constant for color
for (auto color_prop = color_elem->firstProperty(); color_prop->hasContent(); color_prop = color_prop->next()) | ||
{ | ||
auto cval = static_cast<int>(std::stof(color_prop->value()) * 0xFF); | ||
if (color_prop->name() == "r") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add constant for r
cdxml_color |= cval << 16; | ||
else if (color_prop->name() == "g") | ||
cdxml_color |= cval << 8; | ||
else if (color_prop->name() == "b") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add constant for b
} | ||
} | ||
} | ||
else if (page_elem->value() == "fonttable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add constnat font fonttable
{ | ||
for (auto font_elem = page_elem->firstChildElement(); font_elem->hasContent(); font_elem = font_elem->nextSiblingElement()) | ||
{ | ||
if (font_elem->name() == "font") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add constant for font
{ | ||
std::string text_element = text_style->name(); | ||
// "s" = parts | ||
if (text_element == "s") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add constant s
if (text_element == "s") | ||
{ | ||
std::string style_text = text_style->getText(); | ||
if (style_text == "+") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add constant +
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no tests for ket v2
Generic request
#1234 – issue name