* src/winfonts/winfnt.c: included George Williams' fix to support version 2 fonts correctly
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
diff --git a/ChangeLog b/ChangeLog
index 633fa6a..2db007b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,9 @@
* src/base/ftobjs.c (open_face): included Graham Asher's fix to
prevent faces without Unicode charmaps from loading
+ * src/winfonts/winfnt.c: included George Williams' fix to support
+ version 2 fonts correctly
+
2002-12-16 David Turner <david@freetype.org>
* docs/VERSION.DLL: updating document to better explain the differences between
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 21ff6df..7040648 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -70,7 +70,7 @@
#undef FT_STRUCTURE
#define FT_STRUCTURE WinFNT_HeaderRec
- FT_FRAME_START( 134 ),
+ FT_FRAME_START( 146 ),
FT_FRAME_USHORT_LE( version ),
FT_FRAME_ULONG_LE ( file_size ),
FT_FRAME_BYTES ( copyright, 60 ),
@@ -106,7 +106,7 @@
FT_FRAME_USHORT_LE( B_space ),
FT_FRAME_USHORT_LE( C_space ),
FT_FRAME_USHORT_LE( color_table_offset ),
- FT_FRAME_BYTES ( reserved, 4 ),
+ FT_FRAME_BYTES ( reserved, 16 ),
FT_FRAME_END
};
@@ -145,6 +145,17 @@
goto Exit;
}
+ /* Version 2 doesn't have these fields */
+ if ( header->version == 0x200 )
+ {
+ header->flags = 0;
+ header->A_space = 0;
+ header->B_space = 0;
+ header->C_space = 0;
+
+ header->color_table_offset = 0;
+ }
+
if ( header->file_type & 1 )
{
FT_TRACE2(( "[can't handle vector FNT fonts]\n" ));
@@ -592,7 +603,7 @@
len = new_format ? 6 : 4;
/* jump to glyph entry */
- p = font->fnt_frame + 118 + len * glyph_index;
+ p = font->fnt_frame + ( new_format ? 146 : 118 ) + len * glyph_index;
bitmap->width = FT_NEXT_SHORT_LE( p );