shithub: freetype+ttf2subf

Download patch

ref: 11cfdd04a257c13956d26f94c83f0b8014a7d4b6
parent: 9928df86f27f4b5e3d50c8526a96df236285952e
author: David Turner <[email protected]>
date: Wed Apr 17 05:37:59 EDT 2002

fixed max advance width computation within T1 driver

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-17  Michael Jansson <[email protected]>
+
+        * src/type1/t1gload.c (T1_Compute_Max_Advance): fixed a small bug
+          that prevented the function to return the correct value.
+
 2002-04-16  Francesco Zappa Nardelli  <[email protected]>
 
 	* src/pcf/pcfread (pcf_get_accell): Fix parsing of accelerator
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -11,6 +11,10 @@
       to rounding errors.  The required vector computation routines have
       been optimized and placed within the "ttinterp.c" file.
 
+    - Fixed the parsing of accelerator tables in the PCF font driver
+    
+    - Fixed the Type1 glyph loader routine used to compute the font's
+      maximum advance width.
 
   II. NEW FEATURES
 
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -103,6 +103,8 @@
     decoder.subrs     = type1->subrs;
     decoder.subrs_len = type1->subrs_len;
 
+    *max_advance = 0;
+
     /* for each glyph, parse the glyph charstring and extract */
     /* the advance width                                      */
     for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ )
@@ -109,10 +111,12 @@
     {
       /* now get load the unscaled outline */
       error = T1_Parse_Glyph( &decoder, glyph_index );
+      if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance )
+        *max_advance = decoder.builder.advance.x;
+        
       /* ignore the error if one occured - skip to next glyph */
     }
 
-    *max_advance = decoder.builder.advance.x;
     return T1_Err_Ok;
   }