]> git.eshelyaron.com Git - emacs.git/commitdiff
; * src/ftfont.c (ftfont_glyph_metrics): Comment on advance rounding.
authorPo Lu <luangruo@yahoo.com>
Tue, 26 Dec 2023 06:09:42 +0000 (14:09 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 26 Dec 2023 06:10:57 +0000 (14:10 +0800)
src/ftfont.c

index d3c836c0f2dcdccc08a720e422b072fcdaf4e42e..46abe35ff9a3640c2a68a349efa0022c48b09765 100644 (file)
@@ -1572,6 +1572,12 @@ ftfont_glyph_metrics (FT_Face ft_face, int c, int *advance, int *lbearing,
   if (FT_Load_Glyph (ft_face, c, FT_LOAD_DEFAULT) == 0)
     {
       FT_Glyph_Metrics *m = &ft_face->glyph->metrics;
+
+      /* At first glance this might appear to truncate the glyph's
+        horizontal advance, but FreeType internally rounds the
+        advance width to a pixel boundary prior to returning these
+        metrics.  */
+
       *advance = m->horiAdvance >> 6;
       *lbearing = m->horiBearingX >> 6;
       *rbearing = (m->horiBearingX + m->width) >> 6;