Detect TrueType Collections by checking the font data header

Instead of checking for "face->num_faces >1". (GNOME bug #577952)
This commit is contained in:
Behdad Esfahbod 2009-04-09 13:31:18 -04:00
parent 1dd95fcb8b
commit 58aa0c8ee8
1 changed files with 9 additions and 2 deletions

View File

@ -245,10 +245,17 @@ ftglue_face_goto_table( FT_Face face,
/* parse the directory table directly, without using
* FreeType's built-in data structures
*/
FT_ULong offset = 0;
FT_ULong offset = 0, sig;
FT_UInt count, nn;
if ( face->num_faces > 1 )
if ( FILE_Seek( 0 ) || ACCESS_Frame( 4 ) )
goto Exit;
sig = GET_Tag4();
FORGET_Frame();
if ( sig == FT_MAKE_TAG( 't', 't', 'c', 'f' ) )
{
/* deal with TrueType collections */