From abc47aa1362713192cf8f6747b8de25a3f54e513 Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Mon, 25 Apr 2011 23:51:04 +0900 Subject: [PATCH] [truetype] Always check the checksum to identify tricky fonts. Some PDF generators mangle the family name badly, prioritize the check by the sfnt table checksums than the check by the family name. For sample PDF, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00073.html * src/truetype/ttobjs.c (tt_check_trickyness): Exchange the order of tt_check_trickyness_family() and tt_check_trickyness_sfnt_ids(). --- ChangeLog | 12 ++++++++++++ src/truetype/ttobjs.c | 14 +++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 425895d92..dfbeb6cfe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2011-04-25 Kan-Ru Chen + + [truetype] Always check the checksum to identify tricky fonts. + + Some PDF generators mangle the family name badly, prioritize + the check by the sfnt table checksums than the check by the + family name. For sample PDF, see + http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00073.html + + * src/truetype/ttobjs.c (tt_check_trickyness): Exchange the order + of tt_check_trickyness_family() and tt_check_trickyness_sfnt_ids(). + 2011-04-22 suzuki toshiya [autofit] Add more Indic scripts with hanging baseline. diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index f6e5f5d2a..82ec0ecad 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -332,21 +332,17 @@ if ( !face ) return FALSE; - /* First, check the face name. */ - if ( face->family_name ) - { - if ( tt_check_trickyness_family( face->family_name ) ) - return TRUE; - else - return FALSE; - } - /* Type42 fonts may lack `name' tables, we thus try to identify */ /* tricky fonts by checking the checksums of Type42-persistent */ /* sfnt tables (`cvt', `fpgm', and `prep'). */ if ( tt_check_trickyness_sfnt_ids( (TT_Face)face ) ) return TRUE; + /* Secondary, check the face name. */ + if ( face->family_name && + tt_check_trickyness_family( face->family_name ) ) + return TRUE; + return FALSE; }