X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Fdali-toolkit-test-utils%2Ftoolkit-text-utils.cpp;h=d98f397d98f045dbb6ab08234d00c62fd4ef0d31;hp=e3ccad8b616026b1a332cd6d89fe22a8e95846b9;hb=92cbca2f5bd2e15fa589448d4c884b71f4fef03c;hpb=6e1032b5996011523338aa4bc5cdbeffcfc71ad5 diff --git a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp index e3ccad8..d98f397 100755 --- a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp +++ b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp @@ -79,7 +79,6 @@ void ClearModelData( CharacterIndex characterIndex, logicalModel->mScriptRuns.Clear(); logicalModel->mFontRuns.Clear(); - logicalModel->mWordBreakInfo.Clear(); logicalModel->mBidirectionalParagraphInfo.Clear(); logicalModel->mCharacterDirections.Clear(); logicalModel->mBidirectionalLineInfo.Clear(); @@ -99,17 +98,18 @@ void CreateTextModel( const std::string& text, const Vector& fontDescriptions, const LayoutOptions& options, Size& layoutSize, - LogicalModelPtr& logicalModel, - VisualModelPtr& visualModel, + ModelPtr& textModel, MetricsPtr& metrics, bool markupProcessorEnabled ) { - logicalModel = LogicalModel::New(); - visualModel = VisualModel::New(); + textModel = Model::New(); ///< Pointer to the text's model. + LogicalModelPtr logicalModel = textModel->mLogicalModel; + VisualModelPtr visualModel = textModel->mVisualModel; MarkupProcessData markupProcessData( logicalModel->mColorRuns, logicalModel->mFontDescriptionRuns, - logicalModel->mEmbeddedItems ); + logicalModel->mEmbeddedItems, + logicalModel->mAnchors ); Length textSize = 0u; const uint8_t* utf8 = NULL; @@ -153,15 +153,6 @@ void CreateTextModel( const std::string& text, return; } - // Retrieves the word break info. The word break info is used to layout the text (where to wrap the text in lines). - Vector& wordBreakInfo = logicalModel->mWordBreakInfo; - wordBreakInfo.Resize( characterCount ); - - SetWordBreakInfo( utf32Characters, - 0u, - characterCount, - wordBreakInfo ); - // 3) Set the script info. MultilanguageSupport multilanguageSupport = MultilanguageSupport::Get(); @@ -291,25 +282,12 @@ void CreateTextModel( const std::string& text, layoutEngine.SetLayout( Layout::Engine::MULTI_LINE_BOX ); // Set the layout parameters. - const Vector& charactersToGlyph = visualModel->mCharactersToGlyph; - const Vector& glyphsPerCharacter = visualModel->mGlyphsPerCharacter; - float outlineWidth = visualModel->GetOutlineWidth(); + textModel->mHorizontalAlignment = Text::HorizontalAlignment::BEGIN; + textModel->mLineWrapMode = LineWrap::WORD; + textModel->mIgnoreSpacesAfterText = true; + textModel->mMatchSystemLanguageDirection = false; Layout::Parameters layoutParameters( textArea, - utf32Characters.Begin(), - lineBreakInfo.Begin(), - wordBreakInfo.Begin(), - ( 0u != characterDirections.Count() ) ? characterDirections.Begin() : NULL, - glyphs.Begin(), - glyphsToCharactersMap.Begin(), - charactersPerGlyph.Begin(), - charactersToGlyph.Begin(), - glyphsPerCharacter.Begin(), - numberOfGlyphs, - Text::HorizontalAlignment::BEGIN, - Text::LineWrap::WORD, - outlineWidth, - true, - false ); + textModel ); Vector& lines = visualModel->mLines; @@ -326,42 +304,10 @@ void CreateTextModel( const std::string& text, bool isAutoScroll = false; layoutEngine.LayoutText( layoutParameters, - glyphPositions, - lines, layoutSize, false, isAutoScroll ); - // 10) Reorder the lines - if( 0u != bidirectionalInfo.Count() ) - { - Vector& bidirectionalLineInfo = logicalModel->mBidirectionalLineInfo; - - // Get the lines - const Length numberOfLines = lines.Count(); - - // Reorder the lines. - bidirectionalLineInfo.Reserve( numberOfLines ); // Reserve because is not known yet how many lines have right to left characters. - ReorderLines( bidirectionalInfo, - 0u, - characterCount, - lines, - bidirectionalLineInfo ); - - // Set the bidirectional info per line into the layout parameters. - layoutParameters.lineBidirectionalInfoRunsBuffer = bidirectionalLineInfo.Begin(); - layoutParameters.numberOfBidirectionalInfoRuns = bidirectionalLineInfo.Count(); - - if( options.reorder ) - { - // Re-layout the text. Reorder those lines with right to left characters. - layoutEngine.ReLayoutRightToLeftLines( layoutParameters, - 0u, - characterCount, - glyphPositions ); - } - } - if( options.align ) { float alignmentOffset = 0.f;