shithub: freetype+ttf2subf

Download patch

ref: d77e72295e2f0494bd993c4f59b642c6bd5c3192
parent: 4c3cc76ba05507c2aa624082d3cb5b28a2ac5930
author: Werner Lemberg <[email protected]>
date: Thu Jun 5 18:07:19 EDT 2008

* src/truetype/ttinterp.c (Ins_IP): Handle case `org_dist == 0'
correctly.  This fixes glyphs `t' and `h' of Arial Narrow at 12ppem.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-06  Werner Lemberg  <[email protected]>
+
+	* src/truetype/ttinterp.c (Ins_IP): Handle case `org_dist == 0'
+	correctly.  This fixes glyphs `t' and `h' of Arial Narrow at 12ppem.
+
 2008-06-03  Werner Lemberg  <[email protected]>
 
 	* include/freetype/ftcache.h (FTC_FaceID): Change type back to
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -6232,9 +6232,13 @@
         org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base );
 
       cur_dist = CUR_Func_project ( &CUR.zp2.cur[point], cur_base );
-      new_dist = ( old_range != 0 )
-                   ? TT_MULDIV( org_dist, cur_range, old_range )
-                   : cur_dist;
+
+      if ( org_dist )
+        new_dist = ( old_range != 0 )
+                     ? TT_MULDIV( org_dist, cur_range, old_range )
+                     : cur_dist;
+      else
+        new_dist = 0;
 
       CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist );
     }