+
+ if( slantDefined )
+ {
+ slant = controller->GetDefaultFontSlant();
+ }
+ }
+ else
+ {
+ weightDefined = controller->IsInputFontWeightDefined();
+ widthDefined = controller->IsInputFontWidthDefined();
+ slantDefined = controller->IsInputFontSlantDefined();
+
+ if( weightDefined )
+ {
+ weight = controller->GetInputFontWeight();
+ }
+
+ if( widthDefined )
+ {
+ width = controller->GetInputFontWidth();
+ }
+
+ if( slantDefined )
+ {
+ slant = controller->GetInputFontSlant();
+ }
+ }
+
+ if( weightDefined || widthDefined || slantDefined )
+ {
+ std::string styleString("{");
+ if( weightDefined )
+ {
+ if( TextAbstraction::FontWeight::NONE != weight )
+ {
+ const std::string weightStr( GetEnumerationName( weight,
+ FONT_WEIGHT_STRING_TABLE,
+ FONT_WEIGHT_STRING_TABLE_COUNT ) );
+
+ styleString += "\"weight\":\"" + weightStr + "\"";
+ }
+ else
+ {
+ weightDefined = false;
+ }
+ }
+
+ if( widthDefined )
+ {
+ if( TextAbstraction::FontWidth::NONE != width )
+ {
+ const std::string widthStr( GetEnumerationName( width,
+ FONT_WIDTH_STRING_TABLE,
+ FONT_WIDTH_STRING_TABLE_COUNT ) );
+
+ if( weightDefined )
+ {
+ styleString += ",";
+ }
+ styleString += "\"width\":\"" + widthStr + "\"";
+ }
+ else
+ {
+ widthDefined = false;
+ }
+ }
+
+ if( slantDefined )
+ {
+ if( TextAbstraction::FontSlant::NONE != slant )
+ {
+ const std::string slantStr( GetEnumerationName( slant,
+ FONT_SLANT_STRING_TABLE,
+ FONT_SLANT_STRING_TABLE_COUNT ) );
+
+ if( weightDefined || widthDefined )
+ {
+ styleString += ",";
+ }
+ styleString += "\"slant\":\"" + slantStr + "\"";
+ }
+ else
+ {
+ slantDefined = false;
+ }
+ }
+
+ if( weightDefined || widthDefined || slantDefined )
+ {
+ styleString += "}";
+ }
+ else
+ {
+ styleString.clear();
+ }
+
+ value = styleString;