X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.cpp;h=ea3369542df9e98e56e5be500a7a51efdd5fb446;hp=b4d4bb56013aae1c2cf5cf0cd10f7b88ff3f652b;hb=b0d779c1461781f29868f5414d2475ab0ba9766b;hpb=1134791cdb74ee5826f0027638f1422abb16b6fc diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index b4d4bb5..ea33695 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -622,6 +622,7 @@ Vector3 Controller::GetNaturalSize() 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 @@ -670,6 +671,7 @@ float Controller::GetHeightForWidth( float width ) 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 @@ -968,6 +970,8 @@ void Controller::UpdateModel( OperationsMask operationsRequired ) } } + Vector 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 @@ -992,6 +996,14 @@ void Controller::UpdateModel( OperationsMask operationsRequired ) 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& glyphs = mImpl->mVisualModel->mGlyphs; @@ -999,8 +1011,9 @@ void Controller::UpdateModel( OperationsMask operationsRequired ) Vector& charactersPerGlyph = mImpl->mVisualModel->mCharactersPerGlyph; if( SHAPE_TEXT & operations ) { + const Vector& textToShape = textMirrored ? mirroredUtf32Characters : utf32Characters; // Shapes the text. - ShapeText( utf32Characters, + ShapeText( textToShape, lineBreakInfo, scripts, validFonts,