From 6d79f214e14f8b6d6e9c79cec491383223b37faf Mon Sep 17 00:00:00 2001 From: David Turner Date: Fri, 1 Sep 2006 14:09:35 +0000 Subject: [PATCH] * src/truetype/ttobjs.c: updated the TrueType loader to recognize a few fonts that require the automatic unpatented loader --- ChangeLog | 5 +++++ src/truetype/ttobjs.c | 25 ++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44326d699..0622e3224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-09-01 David Turner + + * src/truetype/ttobjs.c: updated the TrueType loader to recognize + a few fonts that require the automatic unpatented loader + 2006-08-29 Dr. Werner Fink * configure: Make it possible to handle configure options which diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index 3dd8b5c9c..c9a0310cf 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -266,9 +266,28 @@ */ if ( !face->unpatented_hinting ) { - /* XXX: TODO: */ - if ( strcmp( ttface->family_name, "What?" ) == 0 ) - face->unpatented_hinting = 1; + static const char* const trick_names[] = + { + "DFKaiSho-SB", /* dfkaisb.ttf */ + "DFKai-SB", /* kaiu.ttf */ + "HuaTianSongTi?", /* htst3.ttf */ + "MingLiU", /* mingliu.ttf & mingliu.ttc */ + "PMingLiU", /* mingliu.ttc */ + NULL + }; + int nn; + + /* note that we only check the face name at the moment, it might + * be worthy to do more checks for a few special cases + */ + for ( nn = 0; trick_names[nn] != NULL; nn++ ) + { + if ( ft_strcmp( ttface->family_name, trick_names[nn] ) == 0 ) + { + face->unpatented_hinting = 1; + break; + } + } } ttface->internal->force_autohint = !face->unpatented_hinting;