- const Length characterCount = logicalModel.GetNumberOfCharacters();
-
- Vector<GlyphInfo> glyphs;
- glyphs.Reserve( characterCount );
-
- Vector<CharacterIndex> characterIndices;
- characterIndices.Reserve( characterCount );
-
- std::vector<Length> charactersPerGlyph;
- charactersPerGlyph.assign( characterCount, 1 );
-
- for( unsigned int i=0; i<characterCount; ++i )
- {
- Character charcode;
- logicalModel.GetText( i, &charcode, 1 );
-
- // TODO - Perform shaping to get correct glyph indices
- GlyphIndex glyphIndex = mFontClient.GetGlyphIndex( fontId, charcode );
-
- glyphs.PushBack( GlyphInfo(fontId, glyphIndex) );
- characterIndices.PushBack( 1 );
- }
-
- if( mFontClient.GetGlyphMetrics( &glyphs[0], glyphs.Size() ) )
- {
- visualModel.SetGlyphs( &glyphs[0],
- &characterIndices[0],
- &charactersPerGlyph[0],
- characterCount );
-
- UpdateGlyphPositions( boundingBox, visualModel );
- }