X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Frendering%2Ftext-typesetter.cpp;h=0256a43e8d3c8b3c9e14ca77f7fb78f758d3ca37;hb=666b4b2f13d2f417557180a8440c6686c5dbfe83;hp=20ea5f72f0b8b51a61773f4c8739868d3f9d5940;hpb=10bc364fd6c2989274886822794fa8bf87046037;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/rendering/text-typesetter.cpp b/dali-toolkit/internal/text/rendering/text-typesetter.cpp index 20ea5f7..0256a43 100755 --- a/dali-toolkit/internal/text/rendering/text-typesetter.cpp +++ b/dali-toolkit/internal/text/rendering/text-typesetter.cpp @@ -337,6 +337,7 @@ PixelData Typesetter::Render( const Vector2& size, Toolkit::DevelText::TextDirec case VerticalAlignment::CENTER: { penY = static_cast( 0.5f * ( size.height - layoutSize.height ) ); + penY = penY < 0.f ? 0.f : penY; break; } case VerticalAlignment::BOTTOM: @@ -683,6 +684,7 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer( const unsigned int bufferWidth // Don't render outline for other styles outlineWidth = 0.0f; } + if( style != Typesetter::STYLE_UNDERLINE ) { fontClient.CreateBitmap( glyphInfo->fontId, @@ -693,15 +695,30 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer( const unsigned int bufferWidth static_cast( outlineWidth ) ); } - // Sets the glyph's bitmap into the bitmap of the whole text. if( NULL != glyphData.glyphBitmap.buffer ) { + if ( style == Typesetter::STYLE_OUTLINE ) + { + // Set the position offset for the current glyph + glyphData.horizontalOffset -= glyphData.glyphBitmap.outlineOffsetX; + glyphData.verticalOffset -= glyphData.glyphBitmap.outlineOffsetY; + } + + // Set the buffer of the glyph's bitmap into the final bitmap's buffer TypesetGlyph( glyphData, position, &color, style, pixelFormat); + + if ( style == Typesetter::STYLE_OUTLINE ) + { + // Reset the position offset for the next glyph + glyphData.horizontalOffset += glyphData.glyphBitmap.outlineOffsetX; + glyphData.verticalOffset += glyphData.glyphBitmap.outlineOffsetY; + } + // delete the glyphBitmap.buffer as it is now copied into glyphData.bitmapBuffer delete []glyphData.glyphBitmap.buffer; glyphData.glyphBitmap.buffer = NULL;