Support paragraph attribute: relative line height
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / markup-processor-paragraph.cpp
index 35a1cc5..859547e 100644 (file)
@@ -34,7 +34,8 @@ namespace Text
 namespace
 {
 const std::string XHTML_ALIGN_ATTRIBUTE("align");
-}
+const std::string XHTML_RELATIVE_LINE_HEIGHT_ATTRIBUTE("rel-line-height");
+} // namespace
 
 void ProcessHorizontalAlignment(const Attribute& attribute, BoundedParagraphRun& boundedParagraphRun)
 {
@@ -43,6 +44,12 @@ void ProcessHorizontalAlignment(const Attribute& attribute, BoundedParagraphRun&
                                                                                             boundedParagraphRun.horizontalAlignment);
 }
 
+void ProcessRelativeLineHeight(const Attribute& attribute, BoundedParagraphRun& boundedParagraphRun)
+{
+  boundedParagraphRun.relativeLineSize        = StringToFloat(attribute.valueBuffer);
+  boundedParagraphRun.relativeLineSizeDefined = true;
+}
+
 void ProcessAttributesOfParagraphTag(const Tag& tag, BoundedParagraphRun& boundedParagraphRun)
 {
   // By default the align attribute is not defined until it's parsed.
@@ -58,9 +65,12 @@ void ProcessAttributesOfParagraphTag(const Tag& tag, BoundedParagraphRun& bounde
     {
       ProcessHorizontalAlignment(attribute, boundedParagraphRun);
     }
+    else if(TokenComparison(XHTML_RELATIVE_LINE_HEIGHT_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength))
+    {
+      ProcessRelativeLineHeight(attribute, boundedParagraphRun);
+    }
   }
 }
-
 } // namespace Text
 
 } // namespace Toolkit