* src/sfnt/sfobjs.c (tt_face_get_name): Make sure that an English name record for the Apple platform is preferred to a non-English entry for the Microsoft platform. Problem reported by HANDA Ken'ichi.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
diff --git a/ChangeLog b/ChangeLog
index 7e3f632..538269a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-06-01 Werner Lemberg <wl@gnu.org>
+
+ * src/sfnt/sfobjs.c (tt_face_get_name): Make sure that an English
+ name record for the Apple platform is preferred to a non-English
+ entry for the Microsoft platform. Problem reported by HANDA
+ Ken'ichi.
+
2004-05-19 George Williams <gww@silcom.com>
* src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): New
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 5fca215..31281df 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -160,6 +160,8 @@
FT_Int found_win = -1;
FT_Int found_unicode = -1;
+ FT_Bool is_english;
+
TT_NameEntry_ConvertFunc convert;
@@ -205,7 +207,8 @@
case TT_MS_ID_SYMBOL_CS:
case TT_MS_ID_UNICODE_CS:
case TT_MS_ID_UCS_4:
- found_win = n;
+ is_english = ( rec->languageID & 0x3FF ) == 0x009;
+ found_win = n;
break;
default:
@@ -222,9 +225,10 @@
/* 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) */
/* */
convert = NULL;
- if ( found_win >= 0 )
+ if ( found_win >= 0 && !( found_apple >= 0 && !is_english ) )
{
rec = face->name_table.names + found_win;
switch ( rec->encodingID )