[Tizen] Fix small font size text layout issue 97/305597/1
authorBowon Ryu <bowon.ryu@samsung.com>
Thu, 15 Jun 2023 05:56:36 +0000 (14:56 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Mon, 5 Feb 2024 08:40:51 +0000 (17:40 +0900)
Previously, text always rounded down the advance to upload it in the pixel buffer.
but this caused a issue where certain glyphs appeared too close together
when the font size was very small.
Now, rounding the advance values for a more natural layout.

Change-Id: I35c3138c59e3cc8b9418ac448d256e83e33046b0
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
dali/internal/text/text-abstraction/plugin/font-face-cache-item.cpp

index 90fbb02..6ad5c96 100644 (file)
@@ -308,6 +308,7 @@ bool FontFaceCacheItem::GetGlyphMetrics(GlyphInfo& glyphInfo, unsigned int dpiVe
         glyphInfo.xBearing += static_cast<float>(metrics.vertBearingX) * FROM_266;
         glyphInfo.yBearing += static_cast<float>(metrics.vertBearingY) * FROM_266;
       }
+      glyphInfo.advance = round(glyphInfo.advance);
 
       const bool isEmboldeningRequired = glyphInfo.isBoldRequired && !(glyphData.mStyleFlags & FT_STYLE_FLAG_BOLD);
       if(isEmboldeningRequired)