]> git.wh0rd.org - fontconfig.git/commitdiff
Detect TrueType Collections by checking the font data header
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 9 Apr 2009 17:31:18 +0000 (13:31 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 24 Jun 2009 17:52:10 +0000 (13:52 -0400)
Instead of checking for "face->num_faces >1". (GNOME bug #577952)

src/ftglue.c

index 9caad7c6a7ab3a45a1176b476bfe8f7c6c4e7da6..b337751a975715627bd723053a95ba4670941594 100644 (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 */