X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fmarkup-processor-font.cpp;h=0c469b8fb0a7c981651824486e7140429f44a05d;hb=e7066ac660369db5c7592a03e2f19dbf30e59db5;hp=df8b6ec9cc601b22e14a75d634077210ba9ec9d6;hpb=e172c89c895d46d430b2cf0a0dbceeea0ae09b29;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/markup-processor-font.cpp b/dali-toolkit/internal/text/markup-processor-font.cpp index df8b6ec..0c469b8 100644 --- a/dali-toolkit/internal/text/markup-processor-font.cpp +++ b/dali-toolkit/internal/text/markup-processor-font.cpp @@ -24,6 +24,7 @@ // INTERNAL INCLUDES #include +#include #include #include @@ -68,35 +69,23 @@ void ProcessFontFamily(const Attribute& attribute, FontDescriptionRun& fontRun) void ProcessFontSize(const Attribute& attribute, FontDescriptionRun& fontRun) { // 64.f is used to convert from point size to 26.6 pixel format. - fontRun.size = static_cast(StringToFloat(attribute.valueBuffer) * PIXEL_FORMAT_64_FACTOR); + fontRun.size = static_cast(ProcessFloatAttribute(attribute) * PIXEL_FORMAT_64_FACTOR); fontRun.sizeDefined = true; } void ProcessFontWeight(const Attribute& attribute, FontDescriptionRun& fontRun) { - char value[MAX_FONT_ATTRIBUTE_SIZE + 1u]; - processFontAttributeValue(value, attribute); - - fontRun.weight = StringToWeight(value); - fontRun.weightDefined = true; + fontRun.weightDefined = ProcessEnumerationAttribute(attribute, MAX_FONT_ATTRIBUTE_SIZE, &StringToWeight, fontRun.weight); } void ProcessFontWidth(const Attribute& attribute, FontDescriptionRun& fontRun) { - char value[MAX_FONT_ATTRIBUTE_SIZE + 1u]; - processFontAttributeValue(value, attribute); - - fontRun.width = StringToWidth(value); - fontRun.widthDefined = true; + fontRun.widthDefined = ProcessEnumerationAttribute(attribute, MAX_FONT_ATTRIBUTE_SIZE, &StringToWidth, fontRun.width); } void ProcessFontSlant(const Attribute& attribute, FontDescriptionRun& fontRun) { - char value[MAX_FONT_ATTRIBUTE_SIZE + 1u]; - processFontAttributeValue(value, attribute); - - fontRun.slant = StringToSlant(value); - fontRun.slantDefined = true; + fontRun.slantDefined = ProcessEnumerationAttribute(attribute, MAX_FONT_ATTRIBUTE_SIZE, &StringToSlant, fontRun.slant); } void ProcessFontTag(const Tag& tag, FontDescriptionRun& fontRun)