summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-04-09 13:31:18 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-06-24 13:52:10 -0400
commit58aa0c8ee83f7bbd232401583106387517d216a9 (patch)
tree96d98238fd17dfe813845b7ac403d509379ad90b
parent1dd95fcb8bb9b5feeabee0dfe334448733f5cb4c (diff)
Detect TrueType Collections by checking the font data header
Instead of checking for "face->num_faces >1". (GNOME bug #577952)
-rw-r--r--src/ftglue.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ftglue.c b/src/ftglue.c
index 9caad7c6..b337751a 100644
--- a/src/ftglue.c
+++ b/src/ftglue.c
@@ -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 */