Commit f3050059dd18c2efe6dc455bbf86a2405f4959cc

David Turner 2006-09-11T12:00:32

* src/sfnt/sfobjs.c (tt_face_get_name): support some function which report their English names through an Apple Roman (platform,encoding) pair, with language_id != English if the font uses another name entry with language_id == English, it will be selected correctly though. * src/truetype/ttobjs.c: add unpatent-hinting selection for "mingli.ttf"

diff --git a/ChangeLog b/ChangeLog
index 24ae9cf..a4a4d27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-09-11  David Turner  <david@freetype.org>
+
+        * src/sfnt/sfobjs.c (tt_face_get_name): support some function
+        which report their English names through an Apple Roman
+        (platform,encoding) pair, with language_id != English
+
+        if the font uses another name entry with language_id == English,
+        it will be selected correctly though.
+
+        * src/truetype/ttobjs.c: add unpatent-hinting selection for
+        "mingli.ttf"
+
 2006-09-05  Werner Lemberg  <wl@gnu.org>
 
 	* src/truetype/ttpload.c (tt_face_load_hdmx): Handle `record_size'
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 869269c..d9c1cb4 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -165,9 +165,11 @@
     FT_String*        result = NULL;
     FT_UShort         n;
     TT_NameEntryRec*  rec;
-    FT_Int            found_apple   = -1;
-    FT_Int            found_win     = -1;
-    FT_Int            found_unicode = -1;
+    FT_Int            found_apple         = -1;
+    FT_Int            found_apple_roman   = -1;
+    FT_Int            found_apple_english = -1;
+    FT_Int            found_win           = -1;
+    FT_Int            found_unicode       = -1;
 
     FT_Bool           is_english = 0;
 
@@ -200,8 +202,14 @@
           break;
 
         case TT_PLATFORM_MACINTOSH:
+          /* This is a bit special, because some fonts will use either
+           * an English language id, or a Roman encoding id, to indicate
+           * the English version of their font name
+           */
           if ( rec->languageID == TT_MAC_LANGID_ENGLISH )
-            found_apple = n;
+            found_apple_english = n;
+          else if ( rec->encodingID == TT_MAC_ID_ROMAN )
+            found_apple_roman = n;
 
           break;
 
@@ -232,6 +240,10 @@
       }
     }
 
+    found_apple = found_apple_roman;
+    if ( found_apple_english >= 0 )
+      found_apple = found_apple_english;
+
     /* some fonts contain invalid Unicode or Macintosh formatted entries; */
     /* we will thus favor names encoded in Windows formats if available   */
     /* (provided it is an English name)                                   */
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 13eddf0..7241931 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -272,6 +272,7 @@
         "HuaTianSongTi?",  /* htst3.ttf */
         "MingLiU",         /* mingliu.ttf & mingliu.ttc */
         "PMingLiU",        /* mingliu.ttc */
+        "MingLi43",        /* mingli.ttf */
         NULL
       };
       int  nn;