Adjust the yBearing value of the emoji. 11/266011/1
authorjoogab.yun <joogab.yun@samsung.com>
Thu, 4 Nov 2021 04:21:10 +0000 (13:21 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Thu, 4 Nov 2021 04:21:10 +0000 (13:21 +0900)
Change-Id: Ie3491ba85ede1cc56e5315ce0a44b9c4f6dcc159

dali/internal/text/text-abstraction/plugin/font-face-cache-item.cpp

index 5608b03..d017695 100644 (file)
@@ -117,7 +117,14 @@ bool FontFaceCacheItem::GetGlyphMetrics(GlyphInfo& glyph, unsigned int dpiVertic
       glyph.height   = mFixedHeightPixels;
       glyph.advance  = mFixedWidthPixels;
       glyph.xBearing = 0.0f;
-      glyph.yBearing = mFixedHeightPixels;
+      if(horizontal)
+      {
+        glyph.yBearing += static_cast<float>(ftFace->glyph->metrics.horiBearingY) * FROM_266;
+      }
+      else
+      {
+        glyph.yBearing += static_cast<float>(ftFace->glyph->metrics.vertBearingY) * FROM_266;
+      }
 
       // Adjust the metrics if the fixed-size font should be down-scaled
       const float desiredFixedSize = static_cast<float>(mRequestedPointSize) * FROM_266 / POINTS_PER_INCH * dpiVertical;