X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-view.cpp;h=be6ac8f9733cd7bc420544da1f1064b59dca2d02;hb=c156fa43a739e26d4d1ad187848968248078839f;hp=8d10b2ad8c63009544cfe4d3d666ed8e598da485;hpb=974d2c9d9bb99f7234eda29b97e2b1ca30733d05;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-view.cpp b/dali-toolkit/internal/text/text-view.cpp index 8d10b2a..be6ac8f 100644 --- a/dali-toolkit/internal/text/text-view.cpp +++ b/dali-toolkit/internal/text/text-view.cpp @@ -65,6 +65,16 @@ const Vector2& View::GetControlSize() const return Vector2::ZERO; } +const Vector2& View::GetLayoutSize() const +{ + if ( mImpl->mVisualModel ) + { + return mImpl->mVisualModel->GetLayoutSize(); + } + + return Vector2::ZERO; +} + Length View::GetNumberOfGlyphs() const { if( mImpl->mVisualModel ) @@ -146,19 +156,28 @@ Length View::GetGlyphs( GlyphInfo* glyphs, GlyphIndex lastGlyphIndexOfLine = line->glyphRun.glyphIndex + line->glyphRun.numberOfGlyphs - 1u; // Add the alignment offset to the glyph's position. + + float penY = line->ascender; for( Length index = 0u; index < numberOfLaidOutGlyphs; ++index ) { - ( *( glyphPositions + index ) ).x += line->alignmentOffset; + Vector2& position = *( glyphPositions + index ); + position.x += line->alignmentOffset; + position.y += penY; if( lastGlyphIndexOfLine == index ) { + penY += -line->descender; + // Get the next line. ++lineIndex; if( lineIndex < numberOfLines ) { line = lineBuffer + lineIndex; + lastGlyphIndexOfLine = line->glyphRun.glyphIndex + line->glyphRun.numberOfGlyphs - 1u; + + penY += line->ascender; } } } @@ -266,6 +285,26 @@ Length View::GetGlyphs( GlyphInfo* glyphs, return numberOfLaidOutGlyphs; } +const Vector4* const View::GetColors() const +{ + if( mImpl->mVisualModel ) + { + return mImpl->mVisualModel->mColors.Begin(); + } + + return NULL; +} + +const ColorIndex* const View::GetColorIndices() const +{ + if( mImpl->mVisualModel ) + { + return mImpl->mVisualModel->mColorIndices.Begin(); + } + + return NULL; +} + const Vector4& View::GetTextColor() const { if( mImpl->mVisualModel )