fixed max advance width computation within T1 driver
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
diff --git a/ChangeLog b/ChangeLog
index f750488..e2179fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-17 Michael Jansson <mjan@em2-solutions.com>
+
+ * 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 <Francesco.Zappa.Nardelli@ens.fr>
* src/pcf/pcfread (pcf_get_accell): Fix parsing of accelerator
diff --git a/docs/CHANGES b/docs/CHANGES
index 3fc0b6b..e818158 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -11,6 +11,10 @@ LATEST CHANGES BETWEEN 2.1.0 and 2.0.9
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
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index 7617b00..ecaccb2 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -103,16 +103,20 @@
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++ )
{
/* 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;
}