shithub: freetype+ttf2subf

Download patch

ref: 62f8978794fd7736feaeaedd7ef3f62e1eb6a7eb
parent: 34f4f39ad8d56a2153080f865afd4bd01ed6d63f
author: Werner Lemberg <[email protected]>
date: Thu Dec 9 17:57:18 EST 2004

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

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-12-09  Werner Lemberg  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* src/base/ftobjs.c (ft_glyphslot_clear): Reset `lsb_delta' and
--- 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 );
           }
         }
       }