Merge "Adjust the yBearing value of the emoji." into devel/master
authorjoogab yun <joogab.yun@samsung.com>
Thu, 18 Nov 2021 01:12:28 +0000 (01:12 +0000)
committerGerrit Code Review <gerrit@review>
Thu, 18 Nov 2021 01:12:28 +0000 (01:12 +0000)
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;