X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fglyph-metrics-helper.cpp;h=c46fefd26a014fa49c4ce7597a11d3eeba99510e;hb=702cdc29b907688eef62afbc63f0edb9e2dfb7d2;hp=01c62c7fff31e6ebcaa4e023f743e5530fcac6a2;hpb=d7bf9a0c46a7900e7c066711463babd639154f73;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/glyph-metrics-helper.cpp b/dali-toolkit/internal/text/glyph-metrics-helper.cpp index 01c62c7..c46fefd 100644 --- a/dali-toolkit/internal/text/glyph-metrics-helper.cpp +++ b/dali-toolkit/internal/text/glyph-metrics-helper.cpp @@ -19,6 +19,9 @@ // FILE HEADER #include +// INTERNAL INCLUDES +#include + namespace Dali { namespace Toolkit @@ -114,7 +117,10 @@ void GetGlyphMetricsFromCharacterIndex(CharacterIndex index, const GlyphInfo* const glyphInfoBuffer = visualModel->mGlyphs.Begin(); Vector& glyphToCharacterMap = visualModel->mGlyphsToCharacters; const CharacterIndex* glyphToCharacterMapBuffer = glyphToCharacterMap.Begin(); - const float characterSpacing = visualModel->GetCharacterSpacing(); + const float modelCharacterSpacing = visualModel->GetCharacterSpacing(); + + // Get the character-spacing runs. + const Vector& characterSpacingGlyphRuns = visualModel->GetCharacterSpacingGlyphRuns(); //Takes the character index, obtains the glyph index (and the number of Glyphs) from it and finally gets the glyph metrics. glyphIndex = *(charactersToGlyphBuffer + index); @@ -122,7 +128,8 @@ void GetGlyphMetricsFromCharacterIndex(CharacterIndex index, float calculatedAdvance = 0.f; - calculatedAdvance = GetCalculatedAdvance(*(logicalModel->mText.Begin() + (*(glyphToCharacterMapBuffer + glyphIndex))), characterSpacing, (*(visualModel->mGlyphs.Begin() + glyphIndex)).advance); + const float characterSpacing = GetGlyphCharacterSpacing(glyphIndex, characterSpacingGlyphRuns, modelCharacterSpacing); + calculatedAdvance = GetCalculatedAdvance(*(logicalModel->mText.Begin() + (*(glyphToCharacterMapBuffer + glyphIndex))), characterSpacing, (*(visualModel->mGlyphs.Begin() + glyphIndex)).advance); // Get the metrics for the group of glyphs. GetGlyphsMetrics(glyphIndex,