From ee33f54bcefdc59971ffa428e6f8e4bdd31b94ed Mon Sep 17 00:00:00 2001 From: ssabah Date: Thu, 24 Feb 2022 15:15:24 +0200 Subject: [PATCH] Support the underline and its attributes in span tag The attributes of underline : - u-color - u-height - u-type - u-dash-gap - u-dash-width How to apply it in TextLabel: textLabel.SetProperty(Dali::Toolkit::TextLabel::Property::TEXT, "Before Hello World after."); textLabel.SetProperty(Dali::Toolkit::TextLabel::Property::ENABLE_MARKUP, true); Change-Id: Ia3dfd19e0f7a40903785e6d93d2587b9bfcac056 --- .../utc-Dali-TextEditor-internal.cpp | 211 +++++++++++++++++++++ .../utc-Dali-TextField-internal.cpp | 211 +++++++++++++++++++++ .../utc-Dali-TextLabel-internal.cpp | 211 +++++++++++++++++++++ .../internal/text/markup-processor-span.cpp | 41 +++- dali-toolkit/internal/text/markup-processor-span.h | 10 +- dali-toolkit/internal/text/markup-processor.cpp | 64 +++++-- .../internal/text/underline-style-properties.h | 2 +- 7 files changed, 727 insertions(+), 23 deletions(-) diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp index 99b9e03..53474ae 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp @@ -347,6 +347,217 @@ int UtcDaliTextEditorMarkupUnderlineAttributes(void) END_TEST; } +int UtcDaliTextEditorMarkupSpanUnderline(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextEditorMarkupSpanUnderline "); + + TextEditor textEditor = TextEditor::New(); + + application.GetScene().Add(textEditor); + + std::string testText = + "startABC1then" + "ABC2then" + "ABC3then" + "ABC4then" + "ABC5then" + "ABC6then" + "ABC7then" + "ABC8then" + "ABC9end" + + ; + + textEditor.SetProperty(TextEditor::Property::TEXT, testText); + textEditor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); + + application.SendNotification(); + application.Render(); + + const uint32_t NUMBER_OF_CASES = 8u; + uint32_t expectedNumberOfUnderlinedGlyphs = 32u; + + Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor); + const Text::Length numberOfUnderlineRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns(); + + DALI_TEST_EQUALS(numberOfUnderlineRuns, expectedNumberOfUnderlinedGlyphs, TEST_LOCATION); + + Vector underlineRuns; + underlineRuns.Resize(numberOfUnderlineRuns); + textEditorImpl.GetTextController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns); + + struct DataOfCase + { + std::string title; + uint32_t startIndex; + uint32_t endIndex; + GlyphIndex startGlyphIndex; + GlyphIndex endGlyphIndex; + UnderlineStyleProperties properties; + }; + DataOfCase data[] = + { + + {"ABC2", + 0u, + 3u, + 13u, + 16u, + { + Text::Underline::SOLID, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + {"ABC3", + 4u, + 7u, + 21u, + 24u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + {"ABC4", + 8u, + 11u, + 29u, + 32u, + { + Text::Underline::DOUBLE, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + {"ABC5", + 12u, + 15u, + 37u, + 40u, + { + Text::Underline::SOLID, + Color::GREEN, + 0u, + 1u, + 2u, + false, + true, + false, + false, + false, + }}, + + {"ABC6", + 16u, + 19u, + 45u, + 48u, + { + Text::Underline::SOLID, + Color::BLACK, + 5u, + 1u, + 2u, + false, + false, + true, + false, + false, + }}, + + {"ABC7", + 20u, + 23u, + 53u, + 56u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 3u, + 2u, + true, + false, + false, + true, + false, + }}, + + {"ABC8", + 24u, + 27u, + 61u, + 64u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 1u, + 4u, + true, + false, + false, + false, + true, + }}, + + {"ABC9", + 28u, + 31u, + 69u, + 72u, + { + Text::Underline::DASHED, + Color::BLUE, + 4u, + 2u, + 3u, + true, + true, + true, + true, + true, + }}, + + }; + + for(uint32_t i = 0; i < NUMBER_OF_CASES; i++) + { + tet_infoline(data[i].title.c_str()); + DALI_TEST_EQUALS(underlineRuns[data[i].startIndex].glyphRun.glyphIndex, data[i].startGlyphIndex, TEST_LOCATION); + DALI_TEST_EQUALS(underlineRuns[data[i].endIndex].glyphRun.glyphIndex, data[i].endGlyphIndex, TEST_LOCATION); + + DALI_TEST_CHECK(data[i].properties == underlineRuns[data[i].startIndex].properties); + DALI_TEST_CHECK(data[i].properties == underlineRuns[data[i].endIndex].properties); + } + + END_TEST; +} + int UtcDaliTextEditorFontPointSizeLargerThanAtlas(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp index 8967f0e..472b7e8 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp @@ -429,6 +429,217 @@ int UtcDaliTextFieldMarkupUnderlineAttributes(void) END_TEST; } +int UtcDaliTextFieldMarkupSpanUnderline(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextFieldMarkupSpanUnderline "); + + TextField textField = TextField::New(); + + application.GetScene().Add(textField); + + std::string testText = + "startABC1then" + "ABC2then" + "ABC3then" + "ABC4then" + "ABC5then" + "ABC6then" + "ABC7then" + "ABC8then" + "ABC9end" + + ; + + textField.SetProperty(TextField::Property::TEXT, testText); + textField.SetProperty(TextField ::Property::ENABLE_MARKUP, true); + + application.SendNotification(); + application.Render(); + + const uint32_t NUMBER_OF_CASES = 8u; + uint32_t expectedNumberOfUnderlinedGlyphs = 32u; + + Toolkit::Internal::TextField& textFieldImpl = GetImpl(textField); + const Text::Length numberOfUnderlineRuns = textFieldImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns(); + + DALI_TEST_EQUALS(numberOfUnderlineRuns, expectedNumberOfUnderlinedGlyphs, TEST_LOCATION); + + Vector underlineRuns; + underlineRuns.Resize(numberOfUnderlineRuns); + textFieldImpl.GetTextController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns); + + struct DataOfCase + { + std::string title; + uint32_t startIndex; + uint32_t endIndex; + GlyphIndex startGlyphIndex; + GlyphIndex endGlyphIndex; + UnderlineStyleProperties properties; + }; + DataOfCase data[] = + { + + {"ABC2", + 0u, + 3u, + 13u, + 16u, + { + Text::Underline::SOLID, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + {"ABC3", + 4u, + 7u, + 21u, + 24u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + {"ABC4", + 8u, + 11u, + 29u, + 32u, + { + Text::Underline::DOUBLE, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + {"ABC5", + 12u, + 15u, + 37u, + 40u, + { + Text::Underline::SOLID, + Color::GREEN, + 0u, + 1u, + 2u, + false, + true, + false, + false, + false, + }}, + + {"ABC6", + 16u, + 19u, + 45u, + 48u, + { + Text::Underline::SOLID, + Color::BLACK, + 5u, + 1u, + 2u, + false, + false, + true, + false, + false, + }}, + + {"ABC7", + 20u, + 23u, + 53u, + 56u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 3u, + 2u, + true, + false, + false, + true, + false, + }}, + + {"ABC8", + 24u, + 27u, + 61u, + 64u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 1u, + 4u, + true, + false, + false, + false, + true, + }}, + + {"ABC9", + 28u, + 31u, + 69u, + 72u, + { + Text::Underline::DASHED, + Color::BLUE, + 4u, + 2u, + 3u, + true, + true, + true, + true, + true, + }}, + + }; + + for(uint32_t i = 0; i < NUMBER_OF_CASES; i++) + { + tet_infoline(data[i].title.c_str()); + DALI_TEST_EQUALS(underlineRuns[data[i].startIndex].glyphRun.glyphIndex, data[i].startGlyphIndex, TEST_LOCATION); + DALI_TEST_EQUALS(underlineRuns[data[i].endIndex].glyphRun.glyphIndex, data[i].endGlyphIndex, TEST_LOCATION); + + DALI_TEST_CHECK(data[i].properties == underlineRuns[data[i].startIndex].properties); + DALI_TEST_CHECK(data[i].properties == underlineRuns[data[i].endIndex].properties); + } + + END_TEST; +} + int UtcDaliTextFieldFontPointSizeLargerThanAtlas(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextLabel-internal.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextLabel-internal.cpp index 4259cdc..feed97c 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextLabel-internal.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextLabel-internal.cpp @@ -306,6 +306,217 @@ int UtcDaliTextLabelMarkupUnderlineAttributes(void) END_TEST; } +int UtcDaliTextLabelMarkupSpanUnderline(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextLabelMarkupSpanUnderline "); + + TextLabel textLabel = TextLabel::New(); + + application.GetScene().Add(textLabel); + + std::string testText = + "startABC1then" + "ABC2then" + "ABC3then" + "ABC4then" + "ABC5then" + "ABC6then" + "ABC7then" + "ABC8then" + "ABC9end" + + ; + + textLabel.SetProperty(TextLabel::Property::TEXT, testText); + textLabel.SetProperty(TextLabel ::Property::ENABLE_MARKUP, true); + + application.SendNotification(); + application.Render(); + + const uint32_t NUMBER_OF_CASES = 8u; + uint32_t expectedNumberOfUnderlinedGlyphs = 32u; + + Toolkit::Internal::TextLabel& textLabelImpl = GetImpl(textLabel); + const Text::Length numberOfUnderlineRuns = textLabelImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns(); + + DALI_TEST_EQUALS(numberOfUnderlineRuns, expectedNumberOfUnderlinedGlyphs, TEST_LOCATION); + + Vector underlineRuns; + underlineRuns.Resize(numberOfUnderlineRuns); + textLabelImpl.GetTextController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns); + + struct DataOfCase + { + std::string title; + uint32_t startIndex; + uint32_t endIndex; + GlyphIndex startGlyphIndex; + GlyphIndex endGlyphIndex; + UnderlineStyleProperties properties; + }; + DataOfCase data[] = + { + + {"ABC2", + 0u, + 3u, + 13u, + 16u, + { + Text::Underline::SOLID, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + {"ABC3", + 4u, + 7u, + 21u, + 24u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + {"ABC4", + 8u, + 11u, + 29u, + 32u, + { + Text::Underline::DOUBLE, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + {"ABC5", + 12u, + 15u, + 37u, + 40u, + { + Text::Underline::SOLID, + Color::GREEN, + 0u, + 1u, + 2u, + false, + true, + false, + false, + false, + }}, + + {"ABC6", + 16u, + 19u, + 45u, + 48u, + { + Text::Underline::SOLID, + Color::BLACK, + 5u, + 1u, + 2u, + false, + false, + true, + false, + false, + }}, + + {"ABC7", + 20u, + 23u, + 53u, + 56u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 3u, + 2u, + true, + false, + false, + true, + false, + }}, + + {"ABC8", + 24u, + 27u, + 61u, + 64u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 1u, + 4u, + true, + false, + false, + false, + true, + }}, + + {"ABC9", + 28u, + 31u, + 69u, + 72u, + { + Text::Underline::DASHED, + Color::BLUE, + 4u, + 2u, + 3u, + true, + true, + true, + true, + true, + }}, + + }; + + for(uint32_t i = 0; i < NUMBER_OF_CASES; i++) + { + tet_infoline(data[i].title.c_str()); + DALI_TEST_EQUALS(underlineRuns[data[i].startIndex].glyphRun.glyphIndex, data[i].startGlyphIndex, TEST_LOCATION); + DALI_TEST_EQUALS(underlineRuns[data[i].endIndex].glyphRun.glyphIndex, data[i].endGlyphIndex, TEST_LOCATION); + + DALI_TEST_CHECK(data[i].properties == underlineRuns[data[i].startIndex].properties); + DALI_TEST_CHECK(data[i].properties == underlineRuns[data[i].endIndex].properties); + } + + END_TEST; +} + int UtcDaliTextLabelBackgroundTag(void) { ToolkitTestApplication application; diff --git a/dali-toolkit/internal/text/markup-processor-span.cpp b/dali-toolkit/internal/text/markup-processor-span.cpp index 40a508d..d7bf5eb 100644 --- a/dali-toolkit/internal/text/markup-processor-span.cpp +++ b/dali-toolkit/internal/text/markup-processor-span.cpp @@ -26,6 +26,7 @@ #include #include #include +#include namespace Dali { @@ -42,9 +43,22 @@ const std::string XHTML_WIDTH_ATTRIBUTE("font-width"); const std::string XHTML_SLANT_ATTRIBUTE("font-slant"); const std::string XHTML_COLOR_ATTRIBUTE("text-color"); + +//the underlined character's attributes +const std::string XHTML_UNDERLINE_COLOR_ATTRIBUTE("u-color"); +const std::string XHTML_UNDERLINE_HEIGHT_ATTRIBUTE("u-height"); +const std::string XHTML_UNDERLINE_TYPE_ATTRIBUTE("u-type"); +const std::string XHTML_UNDERLINE_DASH_GAP_ATTRIBUTE("u-dash-gap"); +const std::string XHTML_UNDERLINE_DASH_WIDTH_ATTRIBUTE("u-dash-width"); } // namespace -void ProcessSpanTag(const Tag& tag, ColorRun& colorRun, FontDescriptionRun& fontRun, bool& isColorDefined, bool& isFontDefined) +void ProcessSpanTag(const Tag& tag, + ColorRun& colorRun, + FontDescriptionRun& fontRun, + UnderlinedCharacterRun& underlinedCharacterRun, + bool& isColorDefined, + bool& isFontDefined, + bool& isUnderlinedCharacterDefined) { for(Vector::ConstIterator it = tag.attributes.Begin(), endIt = tag.attributes.End(); @@ -83,6 +97,31 @@ void ProcessSpanTag(const Tag& tag, ColorRun& colorRun, FontDescriptionRun& font isFontDefined = true; ProcessFontSlant(attribute, fontRun); } + else if(TokenComparison(XHTML_UNDERLINE_COLOR_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + { + isUnderlinedCharacterDefined = true; + ProcessColorAttribute(attribute, underlinedCharacterRun); + } + else if(TokenComparison(XHTML_UNDERLINE_HEIGHT_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + { + isUnderlinedCharacterDefined = true; + ProcessHeightAttribute(attribute, underlinedCharacterRun); + } + else if(TokenComparison(XHTML_UNDERLINE_TYPE_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + { + isUnderlinedCharacterDefined = true; + ProcessTypeAttribute(attribute, underlinedCharacterRun); + } + else if(TokenComparison(XHTML_UNDERLINE_DASH_GAP_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + { + isUnderlinedCharacterDefined = true; + ProcessDashGapAttribute(attribute, underlinedCharacterRun); + } + else if(TokenComparison(XHTML_UNDERLINE_DASH_WIDTH_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + { + isUnderlinedCharacterDefined = true; + ProcessDashWidthAttribute(attribute, underlinedCharacterRun); + } } } diff --git a/dali-toolkit/internal/text/markup-processor-span.h b/dali-toolkit/internal/text/markup-processor-span.h index 330caf1..f5c49f6 100644 --- a/dali-toolkit/internal/text/markup-processor-span.h +++ b/dali-toolkit/internal/text/markup-processor-span.h @@ -33,10 +33,18 @@ struct MarkupProcessData; * @param[in] tag The span tag and its attributes. * @param[out] colorRun the color run to be filled. * @param[out] fontRun the font run to be filled. + * @param[out] underlinedCharacterRun the underlined character run to be filled. * @param[out] isColorDefined if the span has color defined. * @param[out] isFontDefined if the span has font defined. + * @param[out] isUnderlinedCharacterDefined if the span has underlined-character defined. */ -void ProcessSpanTag(const Tag& tag, ColorRun& colorRun, FontDescriptionRun& fontRun, bool& isColorDefined, bool& isFontDefined); +void ProcessSpanTag(const Tag& tag, + ColorRun& colorRun, + FontDescriptionRun& fontRun, + UnderlinedCharacterRun& underlinedCharacterRun, + bool& isColorDefined, + bool& isFontDefined, + bool& isUnderlinedCharacterDefined); } // namespace Text diff --git a/dali-toolkit/internal/text/markup-processor.cpp b/dali-toolkit/internal/text/markup-processor.cpp index b41d70b..b09b290 100644 --- a/dali-toolkit/internal/text/markup-processor.cpp +++ b/dali-toolkit/internal/text/markup-processor.cpp @@ -83,7 +83,7 @@ const char NEW_LINE = 0x0A; // ASCII value of the newline. // Range 3 0x10000u < XHTML_DECIMAL_ENTITY_RANGE <= 0x10FFFFu const unsigned long XHTML_DECIMAL_ENTITY_RANGE[] = {0x0u, 0xD7FFu, 0xE000u, 0xFFFDu, 0x10000u, 0x10FFFFu}; -const unsigned int MAX_NUM_OF_ATTRIBUTES = 5u; ///< The font tag has the 'family', 'size' 'weight', 'width' and 'slant' attrubutes. +const unsigned int MAX_NUM_OF_ATTRIBUTES = 11u; ///< The span tag has the 'font-family', 'font-size' 'font-weight', 'font-width', 'font-slant','text-color', 'u-color', 'u-height','u-type','u-dash-gap'and 'u-dash-width' attrubutes. const unsigned int DEFAULT_VECTOR_SIZE = 16u; ///< Default size of run vectors. #if defined(DEBUG_ENABLED) @@ -140,8 +140,10 @@ struct Span { RunIndex colorRunIndex; RunIndex fontRunIndex; + RunIndex underlinedCharacterRunIndex; bool isColorDefined; bool isFontDefined; + bool isUnderlinedCharacterDefined; }; /** @@ -195,10 +197,12 @@ void Initialize(UnderlinedCharacterRun& underlinedCharacterRun) */ void Initialize(Span& span) { - span.colorRunIndex = 0u; - span.isColorDefined = false; - span.fontRunIndex = 0u; - span.isFontDefined = false; + span.colorRunIndex = 0u; + span.isColorDefined = false; + span.fontRunIndex = 0u; + span.isFontDefined = false; + span.underlinedCharacterRunIndex = 0u; + span.isUnderlinedCharacterDefined = false; } /** @@ -719,14 +723,16 @@ void ProcessAnchorTag( * @param[in] tagReference The tagReference we should increment/decrement */ void ProcessSpanForRun( - const Tag& spanTag, - StyleStack& spanStack, - Vector& colorRuns, - Vector& fontRuns, - RunIndex& colorRunIndex, - RunIndex& fontRunIndex, - const CharacterIndex characterIndex, - int& tagReference) + const Tag& spanTag, + StyleStack& spanStack, + Vector& colorRuns, + Vector& fontRuns, + Vector& underlinedCharacterRuns, + RunIndex& colorRunIndex, + RunIndex& fontRunIndex, + RunIndex& underlinedCharacterRunIndex, + const CharacterIndex characterIndex, + int& tagReference) { if(!spanTag.isEndTag) { @@ -737,17 +743,22 @@ void ProcessSpanForRun( FontDescriptionRun fontRun; Initialize(fontRun); + UnderlinedCharacterRun underlinedCharacterRun; + Initialize(underlinedCharacterRun); + Span span; Initialize(span); // Fill the run with the parameters. - colorRun.characterRun.characterIndex = characterIndex; - fontRun.characterRun.characterIndex = characterIndex; + colorRun.characterRun.characterIndex = characterIndex; + fontRun.characterRun.characterIndex = characterIndex; + underlinedCharacterRun.characterRun.characterIndex = characterIndex; - span.colorRunIndex = colorRunIndex; - span.fontRunIndex = fontRunIndex; + span.colorRunIndex = colorRunIndex; + span.fontRunIndex = fontRunIndex; + span.underlinedCharacterRunIndex = underlinedCharacterRunIndex; - ProcessSpanTag(spanTag, colorRun, fontRun, span.isColorDefined, span.isFontDefined); + ProcessSpanTag(spanTag, colorRun, fontRun, underlinedCharacterRun, span.isColorDefined, span.isFontDefined, span.isUnderlinedCharacterDefined); // Push the span into the stack. spanStack.Push(span); @@ -767,6 +778,13 @@ void ProcessSpanForRun( ++fontRunIndex; } + if(span.isUnderlinedCharacterDefined) + { + // Push the run in the logical model. + underlinedCharacterRuns.PushBack(underlinedCharacterRun); + ++underlinedCharacterRunIndex; + } + // Increase reference ++tagReference; } @@ -789,6 +807,12 @@ void ProcessSpanForRun( fontRun.characterRun.numberOfCharacters = characterIndex - fontRun.characterRun.characterIndex; } + if(span.isUnderlinedCharacterDefined) + { + UnderlinedCharacterRun& underlinedCharacterRun = *(underlinedCharacterRuns.Begin() + span.underlinedCharacterRunIndex); + underlinedCharacterRun.characterRun.numberOfCharacters = characterIndex - underlinedCharacterRun.characterRun.characterIndex; + } + --tagReference; } } @@ -1017,7 +1041,7 @@ void ProcessMarkupString(const std::string& markupString, MarkupProcessData& mar /* Underline */ ProcessTagForRun( markupProcessData.underlinedCharacterRuns, styleStack, tag, characterIndex, underlinedCharacterRunIndex, uTagReference, [](const Tag& tag, UnderlinedCharacterRun& run) { - run.properties.color = Color::BLUE; + run.properties.color = Color::BLUE; run.properties.colorDefined = true; ProcessUnderlineTag(tag, run); }); @@ -1048,7 +1072,7 @@ void ProcessMarkupString(const std::string& markupString, MarkupProcessData& mar } else if(TokenComparison(XHTML_SPAN_TAG, tag.buffer, tag.length)) { - ProcessSpanForRun(tag, spanStack, markupProcessData.colorRuns, markupProcessData.fontRuns, colorRunIndex, fontRunIndex, characterIndex, spanTagReference); + ProcessSpanForRun(tag, spanStack, markupProcessData.colorRuns, markupProcessData.fontRuns, markupProcessData.underlinedCharacterRuns, colorRunIndex, fontRunIndex, underlinedCharacterRunIndex, characterIndex, spanTagReference); } else if(TokenComparison(XHTML_STRIKETHROUGH_TAG, tag.buffer, tag.length)) { diff --git a/dali-toolkit/internal/text/underline-style-properties.h b/dali-toolkit/internal/text/underline-style-properties.h index 14016c4..5d89f4b 100644 --- a/dali-toolkit/internal/text/underline-style-properties.h +++ b/dali-toolkit/internal/text/underline-style-properties.h @@ -19,10 +19,10 @@ */ // EXTERNAL INCLUDES +#include #include // INTERNAL INCLUDES - #include namespace Dali -- 2.7.4