X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-view.cpp;h=be6ac8f9733cd7bc420544da1f1064b59dca2d02;hp=88ab012bb3c752b902a741c796fa08290152cbd4;hb=54fbf47db890d0479d19d780de5ea5d860924632;hpb=852a2122606480069d2fb0edb398ef11272b0f43 diff --git a/dali-toolkit/internal/text/text-view.cpp b/dali-toolkit/internal/text/text-view.cpp index 88ab012..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 ) @@ -84,7 +94,6 @@ Length View::GetNumberOfGlyphs() const Length View::GetGlyphs( GlyphInfo* glyphs, Vector2* glyphPositions, - Vector4* glyphColors, GlyphIndex glyphIndex, Length numberOfGlyphs ) const { @@ -147,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; } } } @@ -267,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 )