X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Ftext%2Ftext-utils-devel.cpp;h=401b82f75f26e33f2881fd980ff3ebebe2b8e882;hb=309be8bafca890aea5baad5c46679cf207adb497;hp=7b5e36e3b0e1ce5b9af07a61a31413534284b4c2;hpb=22451f7abe0230b418d551d9eac0c685273e72f1;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/text/text-utils-devel.cpp b/dali-toolkit/devel-api/text/text-utils-devel.cpp index 7b5e36e..401b82f 100644 --- a/dali-toolkit/devel-api/text/text-utils-devel.cpp +++ b/dali-toolkit/devel-api/text/text-utils-devel.cpp @@ -34,8 +34,9 @@ #include #include #include -#include +#include #include +#include #include #include #include @@ -178,7 +179,8 @@ void ShapeTextPreprocess(const RendererParameters& textParameters, TextAbstracti textModel->mLogicalModel->mUnderlinedCharacterRuns, textModel->mLogicalModel->mBackgroundColorRuns, textModel->mLogicalModel->mStrikethroughCharacterRuns, - textModel->mLogicalModel->mBoundedParagraphRuns); + textModel->mLogicalModel->mBoundedParagraphRuns, + textModel->mLogicalModel->mCharacterSpacingCharacterRuns); if(textParameters.markupEnabled) { @@ -819,10 +821,14 @@ void Ellipsis(const RendererParameters& textParameters, TextAbstraction::TextRen Vector& lines = textModel->mVisualModel->mLines; // The laid out lines. Vector& isEmoji = internalDataModel.isEmoji; const Size textLayoutArea = internalDataModel.textLayoutArea; - const float characterSpacing = textModel->mVisualModel->GetCharacterSpacing(); + const float modelCharacterSpacing = textModel->mVisualModel->GetCharacterSpacing(); float calculatedAdvance = 0.f; Vector& glyphToCharacterMap = textModel->mVisualModel->mGlyphsToCharacters; const CharacterIndex* glyphToCharacterMapBuffer = glyphToCharacterMap.Begin(); + + // Get the character-spacing runs. + const Vector& characterSpacingGlyphRuns = textModel->mVisualModel->GetCharacterSpacingGlyphRuns(); + //////////////////////////////////////////////////////////////////////////////// // Ellipsis the text. //////////////////////////////////////////////////////////////////////////////// @@ -908,7 +914,8 @@ void Ellipsis(const RendererParameters& textParameters, TextAbstraction::TextRen firstPenSet = true; } - calculatedAdvance = GetCalculatedAdvance(*(textModel->mLogicalModel->mText.Begin() + (*(glyphToCharacterMapBuffer + index))), characterSpacing, glyphToRemove.advance); + const float characterSpacing = GetGlyphCharacterSpacing(index, characterSpacingGlyphRuns, modelCharacterSpacing); + calculatedAdvance = GetCalculatedAdvance(*(textModel->mLogicalModel->mText.Begin() + (*(glyphToCharacterMapBuffer + index))), characterSpacing, glyphToRemove.advance); removedGlypsWidth += std::min(calculatedAdvance, (glyphToRemove.xBearing + glyphToRemove.width)); // Calculate the width of the ellipsis glyph and check if it fits. @@ -1058,11 +1065,14 @@ Size LayoutText(const RendererParameters& textParameters, TextAbstraction::TextR // Update the visual model. Size newLayoutSize; - bool isAutoScrollEnabled = false; + bool isAutoScrollEnabled = false; + bool isAutoScrollMaxTextureExceeded = false; + layoutEngine.LayoutText(layoutParameters, newLayoutSize, textParameters.ellipsisEnabled, isAutoScrollEnabled, + isAutoScrollMaxTextureExceeded, ellipsisPosition); return newLayoutSize;