Fix a serious bug in the TT hinter. * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Don't shift points vertically before hinting. * docs/CHANGES: Updated. * src/cache/ftcglyph.c (FTC_GNode_UnselectFamily, FTC_GCache_Lookup): A new try to fix comparison with zero.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
diff --git a/ChangeLog b/ChangeLog
index eae1fcc..a5818aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-11-19 Werner Lemberg <wl@gnu.org>
+
+ Fix a serious bug in the TT hinter.
+
+ * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Don't shift
+ points vertically before hinting.
+
+ * docs/CHANGES: Updated.
+
+ * src/cache/ftcglyph.c (FTC_GNode_UnselectFamily,
+ FTC_GCache_Lookup): A new try to fix comparison with zero.
+
2004-11-16 Werner Lemberg <wl@gnu.org>
* builds/unix/configure.ac: Add `-fno-strict-aliasing' if gcc is
diff --git a/docs/CHANGES b/docs/CHANGES
index da17bdc..84b6599 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -13,6 +13,8 @@ LATEST CHANGES BETWEEN 2.1.10 and 2.1.9
NPUSHW instruction wasn't skipped correctly in IF clauses. Some
fonts like `Helvetica 75 Bold' failed.
+ - Another bug in handling TrueType hints caused many distortions.
+
II. IMPORTANT CHANGES
diff --git a/src/cache/ftcglyph.c b/src/cache/ftcglyph.c
index ede5c12..46d5965 100644
--- a/src/cache/ftcglyph.c
+++ b/src/cache/ftcglyph.c
@@ -47,7 +47,7 @@
gnode->family = NULL;
- if ( family && --(FT_Long)(family->num_nodes) <= 0 )
+ if ( family && --family->num_nodes == 0 )
FTC_FAMILY_FREE( family, cache );
}
@@ -189,7 +189,7 @@
error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, anode );
- if ( --(FT_Long)(family->num_nodes) <= 0 )
+ if ( --family->num_nodes == 0 )
FTC_FAMILY_FREE( family, cache );
}
return error;
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 572de84..145ac98 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -797,12 +797,10 @@
if ( IS_HINTED( load->load_flags ) )
{
FT_Pos x = zone->org[n_points-4].x;
- FT_Pos y = zone->org[n_points-2].y;
x = FT_PIX_ROUND( x ) - x;
- y = FT_PIX_ROUND( y ) - y;
- translate_array( n_points, zone->org, x, y );
+ translate_array( n_points, zone->org, x, 0 );
org_to_cur( n_points, zone );