Commit 62f8978794fd7736feaeaedd7ef3f62e1eb6a7eb

Werner Lemberg 2004-12-09T22:57:18

* src/base/ftobjs.c (FT_Get_Kerning): Always round towards zero for FT_KERNING_DEFAULT. This greatly enhances the kerning for small ppem values.

diff --git a/ChangeLog b/ChangeLog
index 5929c89..a247f87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-12-09  Werner Lemberg  <wl@gnu.org>
+
+	* src/base/ftobjs.c (FT_Get_Kerning): Always round towards zero
+	for FT_KERNING_DEFAULT.  This greatly enhances the kerning for
+	small ppem values.
+
 2004-12-08  Werner Lemberg  <wl@gnu.org>
 
 	* src/base/ftobjs.c (ft_glyphslot_clear): Reset `lsb_delta' and
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 4180508..31a7bff 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2137,8 +2137,10 @@
 
           if ( kern_mode != FT_KERNING_UNFITTED )
           {
-            akerning->x = FT_PIX_ROUND( akerning->x );
-            akerning->y = FT_PIX_ROUND( akerning->y );
+            akerning->x = akerning->x > 0 ? FT_PIX_FLOOR( akerning->x )
+                                          : FT_PIX_CEIL( akerning->x );
+            akerning->y = akerning->y > 0 ? FT_PIX_FLOOR( akerning->y )
+                                          : FT_PIX_CEIL( akerning->y );
           }
         }
       }