X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fglyph-metrics-helper.cpp;h=f87555eaa395b8dd947a2f098c4a8ee71862d726;hb=29a52105283ce8ced672ed92545daeacf882316a;hp=1f27a84e1467a508fe269fe9de6baf370887858f;hpb=c052b6678e2c6d8a65545dbbe4531ea7057c1999;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 1f27a84..f87555e 100644 --- a/dali-toolkit/internal/text/glyph-metrics-helper.cpp +++ b/dali-toolkit/internal/text/glyph-metrics-helper.cpp @@ -100,6 +100,20 @@ void GetGlyphsMetrics(GlyphIndex glyphIndex, glyphMetrics.width += (firstGlyph.isItalicRequired && !isItalicFont) ? TextAbstraction::FontClient::DEFAULT_ITALIC_ANGLE * firstGlyph.height : 0.f; } +void GetGlyphMetricsFromCharacterIndex(CharacterIndex index, const GlyphInfo* const glyphInfoBuffer, const GlyphIndex* const charactersToGlyphBuffer, const Length* const glyphsPerCharacterBuffer, MetricsPtr& metrics, GlyphMetrics& glyphMetrics, GlyphIndex& glyphIndex, Length& numberOfGlyphs) +{ + //Takes the character index, obtains the glyph index (and the number of Glyphs) from it and finally gets the glyph metrics. + glyphIndex = *(charactersToGlyphBuffer + index); + numberOfGlyphs = *(glyphsPerCharacterBuffer + index); + + // Get the metrics for the group of glyphs. + GetGlyphsMetrics(glyphIndex, + numberOfGlyphs, + glyphMetrics, + glyphInfoBuffer, + metrics); +} + } // namespace Text } // namespace Toolkit