* src/sfnt/ttload.c (tt_face_load_metrics_header): Ignore missing `hhea' table for SFNT Mac fonts. Change based on a patch by mpsuzuki@hiroshima-u.ac.jp.
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
diff --git a/ChangeLog b/ChangeLog
index 0833e97..87e70ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-20 Werner Lemberg <wl@gnu.org>
+
+ * src/sfnt/ttload.c (tt_face_load_metrics_header): Ignore missing
+ `hhea' table for SFNT Mac fonts. Change based on a patch by
+ mpsuzuki@hiroshima-u.ac.jp.
+
2005-08-20 Masatake YAMATO <jet@gyve.org>
* src/otvalid/otvmod.c (otv_validate): Use ft_validator_run instead
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 0f91984..701dc98 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -1092,12 +1092,20 @@
}
else
{
- /* The horizontal header is mandatory; return an error if we */
- /* don't find it. */
+ /* The horizontal header is mandatory for most fonts; return */
+ /* an error if we don't find it. */
error = face->goto_table( face, TTAG_hhea, stream, 0 );
if ( error )
{
error = SFNT_Err_Horiz_Header_Missing;
+
+ /* No `hhea' table necessary for SFNT Mac fonts. */
+ if ( face->format_tag == TTAG_true )
+ {
+ FT_TRACE2(( "missing. This is an SFNT Mac font.\n"));
+ error = SFNT_Err_Ok;
+ }
+
goto Exit;
}