add shortcuts, node text font attributes

This commit is contained in:
2019-12-02 17:10:08 +01:00
parent baec98835a
commit aac280f48a
8 changed files with 80 additions and 18 deletions

View File

@@ -60,6 +60,7 @@ void NodeText::set_font_size(int size)
void NodeText::parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute* attr)
{
Node::parse_attributes(ka, attr);
std::string id = attr->Name();
switch (ka)
{
case kAttribute::Multiline:
@@ -106,6 +107,12 @@ void NodeText::parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute* att
default:
break;
}
if (id == "size")
m_font_size = attr->IntValue();
else if (id == "weight")
m_font_weight = attr->Value();
else if (id == "italic")
m_font_italic = attr->BoolValue();
}
void NodeText::set_text(const std::string& s)