freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] tt_face_get_name fails to find ASCII name


From: Werner LEMBERG
Subject: Re: [Devel] tt_face_get_name fails to find ASCII name
Date: Sat, 29 May 2004 17:51:49 +0200 (CEST)

> I have a problem with using Freetype 2.1.7 for the Japanese
> fonts HG-GothicB.ttf and HG-MinchoL.ttf that are contained
> in Solaris 2.8. [...]
> 
> The function tt_face_get_name (in src/sfnt/sfobjs.c) prefers
> the second record even if it contains non-English name.  So,
> I'm now using the attached quick&dirty patch.  Could you
> please fix this problem in a cleaner way?

Thanks for the report.  Please try the simpler patch below (relative
to the current CVS; maybe you have to do some manual tweaking).  It
relies on the intelligence of the font creator...


    Werner


======================================================================


--- sfobjs.c.old        Mon May 17 23:51:57 2004
+++ sfobjs.c    Sat May 29 17:46:39 2004
@@ -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 )




reply via email to

[Prev in Thread] Current Thread [Next in Thread]