X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fglyph-metrics-helper.cpp;h=f87555eaa395b8dd947a2f098c4a8ee71862d726;hp=1f27a84e1467a508fe269fe9de6baf370887858f;hb=48000ec3ab1ca2d1f8001d192112e32357bb1dfc;hpb=f0a677dd7b2485269f34dad6f519c7304da6e0eb 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