VALIDATE_FONTS |
GET_LINE_BREAKS |
GET_WORD_BREAKS |
+ BIDI_INFO |
SHAPE_TEXT |
GET_GLYPH_METRICS );
// Make sure the model is up-to-date before layouting
VALIDATE_FONTS |
GET_LINE_BREAKS |
GET_WORD_BREAKS |
+ BIDI_INFO |
SHAPE_TEXT |
GET_GLYPH_METRICS );
// Make sure the model is up-to-date before layouting
}
}
+ Vector<Character> mirroredUtf32Characters;
+ bool textMirrored = false;
if( BIDI_INFO & operations )
{
// Count the number of LINE_NO_BREAK to reserve some space for the vector of paragraph's
scripts,
lineBreakInfo,
bidirectionalInfo );
+
+ if( 0u != bidirectionalInfo.Count() )
+ {
+ // This paragraph has right to left text. Some characters may need to be mirrored.
+ // TODO: consider if the mirrored string can be stored as well.
+
+ textMirrored = GetMirroredText( utf32Characters, mirroredUtf32Characters );
+ }
}
Vector<GlyphInfo>& glyphs = mImpl->mVisualModel->mGlyphs;
Vector<Length>& charactersPerGlyph = mImpl->mVisualModel->mCharactersPerGlyph;
if( SHAPE_TEXT & operations )
{
+ const Vector<Character>& textToShape = textMirrored ? mirroredUtf32Characters : utf32Characters;
// Shapes the text.
- ShapeText( utf32Characters,
+ ShapeText( textToShape,
lineBreakInfo,
scripts,
validFonts,