From: Richard Huang Date: Fri, 18 Oct 2019 13:56:18 +0000 (+0100) Subject: Fix the incorrect offset of text outline X-Git-Tag: dali_1.4.43~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=efcb5c8e24a267e30a8faf9af88177fd75ea37cf;hp=a0cf54dfd8e953411ec0d099f4bbe53f13d5a063;ds=sidebyside Fix the incorrect offset of text outline Change-Id: I1a40cea5ad20308e2e968331a514eb3adc396aa0 --- diff --git a/dali-toolkit/internal/text/rendering/text-typesetter.cpp b/dali-toolkit/internal/text/rendering/text-typesetter.cpp index 20ea5f7..5b424be 100755 --- a/dali-toolkit/internal/text/rendering/text-typesetter.cpp +++ b/dali-toolkit/internal/text/rendering/text-typesetter.cpp @@ -683,6 +683,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 +694,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;