freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 493aa68: [base] Some comments.


From: Werner LEMBERG
Subject: [freetype2] master 493aa68: [base] Some comments.
Date: Fri, 21 Sep 2018 02:33:01 -0400 (EDT)

branch: master
commit 493aa68f5c4cb2e659570809931539dc1987630c
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [base] Some comments.
---
 src/base/ftobjs.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 6509a4a..608c478 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -391,8 +391,10 @@
     case FT_RENDER_MODE_MONO:
       pixel_mode = FT_PIXEL_MODE_MONO;
 #if 1
-      /* undocumented but confirmed: bbox values get rounded    */
-      /* for narrow glyphs bbox is extended to one pixel first  */
+      /* x */
+
+      /* undocumented but confirmed: bbox values get rounded;  */
+      /* for narrow glyphs bbox is extended to one pixel first */
       if ( pbox.xMax - pbox.xMin <= 1 )
       {
         if ( pbox.xMax - pbox.xMin == 0 )
@@ -404,9 +406,14 @@
           cbox.xMin = cbox.xMax = ( cbox.xMin + cbox.xMax ) / 2;
       }
 
+      /* we do asymmetric rounding so that the center */
+      /* of a pixel gets always included              */
+
       pbox.xMin += ( cbox.xMin + 31 ) >> 6;
       pbox.xMax += ( cbox.xMax + 32 ) >> 6;
 
+      /* y */
+
       if ( pbox.yMax - pbox.yMin <= 1 )
       {
         if ( pbox.yMax - pbox.yMin == 0 )



reply via email to

[Prev in Thread] Current Thread [Next in Thread]