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-impl.cpp;h=c2c2fa86bd0bc52d763d74b9ed48e3f15118055f;hp=f85d410edaf22fd21d5bcdab21e5e8c08142e21b;hb=5b4982566aba41b5e21c3b8ce3e01a7e86db8f28;hpb=c8f181e1ca529f7d92ba638ccedadd7dd51be7eb diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index f85d410..c2c2fa8 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -325,6 +325,8 @@ void Controller::Impl::UpdateModel( OperationsMask operationsRequired ) const Length numberOfCharacters = utf32Characters.Count(); Vector& lineBreakInfo = mLogicalModel->mLineBreakInfo; + CharacterIndex startIndex = 0u; + Length requestedNumberOfCharacters = numberOfCharacters; if( GET_LINE_BREAKS & operations ) { // Retrieves the line break info. The line break info is used to split the text in 'paragraphs' to @@ -344,6 +346,8 @@ void Controller::Impl::UpdateModel( OperationsMask operationsRequired ) wordBreakInfo.Resize( numberOfCharacters, TextAbstraction::WORD_NO_BREAK ); SetWordBreakInfo( utf32Characters, + startIndex, + requestedNumberOfCharacters, wordBreakInfo ); } @@ -363,6 +367,8 @@ void Controller::Impl::UpdateModel( OperationsMask operationsRequired ) { // Retrieves the scripts used in the text. multilanguageSupport.SetScripts( utf32Characters, + startIndex, + requestedNumberOfCharacters, scripts ); } @@ -380,6 +386,8 @@ void Controller::Impl::UpdateModel( OperationsMask operationsRequired ) scripts, fontDescriptionRuns, defaultFontId, + startIndex, + requestedNumberOfCharacters, validFonts ); } } @@ -408,23 +416,29 @@ void Controller::Impl::UpdateModel( OperationsMask operationsRequired ) SetBidirectionalInfo( utf32Characters, scripts, lineBreakInfo, + startIndex, + requestedNumberOfCharacters, 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, - bidirectionalInfo ); - // Only set the character directions if there is right to left characters. Vector& directions = mLogicalModel->mCharacterDirections; - directions.Resize( numberOfCharacters ); - GetCharactersDirection( bidirectionalInfo, + numberOfCharacters, + startIndex, + requestedNumberOfCharacters, directions ); + + // 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, + directions, + bidirectionalInfo, + startIndex, + requestedNumberOfCharacters, + mirroredUtf32Characters ); } else { @@ -439,6 +453,7 @@ void Controller::Impl::UpdateModel( OperationsMask operationsRequired ) Vector newParagraphGlyphs; newParagraphGlyphs.Reserve( numberOfParagraphs ); + GlyphIndex startGlyphIndex = 0u; if( SHAPE_TEXT & operations ) { const Vector& textToShape = textMirrored ? mirroredUtf32Characters : utf32Characters; @@ -447,21 +462,24 @@ void Controller::Impl::UpdateModel( OperationsMask operationsRequired ) lineBreakInfo, scripts, validFonts, + startIndex, + startGlyphIndex, + requestedNumberOfCharacters, glyphs, glyphsToCharactersMap, charactersPerGlyph, newParagraphGlyphs ); // Create the 'number of glyphs' per character and the glyph to character conversion tables. - mVisualModel->CreateGlyphsPerCharacterTable( numberOfCharacters ); - mVisualModel->CreateCharacterToGlyphTable( numberOfCharacters ); + mVisualModel->CreateGlyphsPerCharacterTable( startIndex, numberOfCharacters ); + mVisualModel->CreateCharacterToGlyphTable( startIndex, numberOfCharacters ); } const Length numberOfGlyphs = glyphs.Count(); if( GET_GLYPH_METRICS & operations ) { - GlyphInfo* glyphsBuffer = glyphs.Begin(); + GlyphInfo* glyphsBuffer = glyphs.Begin() + startGlyphIndex; mMetrics->GetGlyphMetrics( glyphsBuffer, numberOfGlyphs ); // Update the width and advance of all new paragraph characters.