freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Re: Request about font name problem


From: KUSANO Takayuki
Subject: Re: [Devel] Re: Request about font name problem
Date: Fri, 29 Mar 2002 01:12:37 +0900
User-agent: Wanderlust/2.9.8 (Unchained Melody) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (Unebigoryƍmae) APEL/10.3 Emacs/21.2 (i386-debian-linux-gnu) MULE/5.0 (SAKAKI)

At Thu, 28 Mar 2002 15:23:40 +0100 (CET),
Werner LEMBERG wrote:
> 
> > Hmm, '=' causes problem. I think
> > 
> >   if ( found_win == -1 || (rec->languageID & 0x3FF) == 0x009 )
> > 
> > is correct. And after fixing it, 
> 
> This code is no more in the CVS (neither head nor stable).  Does the
> current versions work for you?

  sfobjs.c which is checked out from cvs.freetype.org still contains
  'found_win = -1'. I expect 'found_win == -1'.

  And even with this fix, some font files' family name contain extra
  '?'. These fonts attributes are:

      platformID: 3 (Microsoft)
      encodingID: 0 (Symbol)
      languageID: 1033 (English/United States)
          string: spelled with only US-ASCII characters, but its encoding
                  is UTF-16.

  For example, Dynalab's DFFrs3.ttc contains following name table:

    No. | P |  E | Lang ( hex ) | NM | String
    1   | 1 |  0 | 0    (0x000) | 1  | 'D' 'F' 'F' 'r' 'e' 'e' 'R' 'y' 'u' 
                                       'S' 'e' 'n' '-' 'W' '3' 
    9   | 1 |  1 | 11   (0x00b) | 1  | 82 'c' 82 'e' 83 't' 83 8a 81 '[' 97 
                                       ac 90 fc 'W' '3' 
    15  | 3 |  0 | 1033 (0x409) | 1  | 00 'D' 00 'F' 00 'F' 00 'r' 00 'e' 00 
                                       'e' 00 'R' 00 'y' 00 'u' 00 'S' 00 'e' 
                                       00 'n' 00 '-' 00 'W' 00 '3' 
    23  | 3 |  1 | 1041 (0x411) | 1  | ff '$' ff '&' '0' d5 '0' ea '0' fc 'm' 
                                       'A' '}' da 00 'W' 00 '3'
    found_unicode=-1, found_apple=1, found_win=15
 
    ----- Face number: 0 -----
 
    font name entries
       family:     ?D?F?F?r?e?e?R?y?u?S?e?n?-?W?3
       style:      Regular
       postscript: DFFreeRyuSen-W3-WIN-RKSJ-H

  The patch to fix this is attached.

  *****

  Currently, I have 119 TTF(TTC) fonts. And with this fix, 118 of 119
  font files return English name correctly.

  But still remains 1 fonts whose name become '?????W3'.
  Following table shows its name table.

    == nameid : 1
    No. | P |  E | Lang ( hex ) | NM | String
    1   | 1 |  0 | 0    (0x000) | 1  | 'D' 'F' 'H' 'S' 'M' 'i' 'n' 'c' 'h' 
                                       'o' 'U' '-' 'W' '3' ' ' ' ' 
    9   | 1 | 25 | 19   (0x013) | 1  | 'D' 'F' 'H' 'S' 'M' 'i' 'n' 'c' 'h' 
                                       'o' 'U' '-' 'W' '3' ' ' ' ' 
    16  | 3 |  1 | 1033 (0x409) | 1  | ff '$' ff '&' '^' 's' 'b' 10 'f' 0e 
                                       'g' 1d 'O' 'S' 00 'W' 00 '3' 
    24  | 3 |  1 | 1041 (0x411) | 1  | ff '$' ff '&' '^' 's' 'b' 10 'f' 0e 
                                       'g' 1d 'O' 'S' 00 'W' 00 '3' 
    found_unicode=-1, found_apple=1, found_win=16
    
    ----- Face number: 0 -----
    
    font name entries
       family:     ???????W3
       style:      Regular
       postscript: DFHSMinchoU-W3-WIN-RKSJ-H

  I hope this helps.

  KUSANO Takayuki <URL:http://www.asahi-net.or.jp/~AE5T-KSN/>

Index: sfobjs.c
===================================================================
RCS file: /cvs/freetype/freetype2/src/sfnt/sfobjs.c,v
retrieving revision 1.49.2.3
diff -u -r1.49.2.3 sfobjs.c
--- sfobjs.c    2002/03/26 17:40:55     1.49.2.3
+++ sfobjs.c    2002/03/28 15:39:25
@@ -199,7 +199,7 @@
               /* we only take a non-English name when there is nothing */
               /* else available in the font..                          */
               /*                                                       */
-              if ( found_win = -1 || (rec->languageID & 0x3FF) == 0x009 )
+              if ( found_win == -1 || (rec->languageID & 0x3FF) == 0x009 )
               {
                 switch ( rec->encodingID )
                 {
@@ -231,15 +231,10 @@
       rec = face->name_table.names + found_win;
       switch ( rec->encodingID )
       {
+        case TT_MS_ID_SYMBOL_CS:
         case TT_MS_ID_UNICODE_CS:
           {
             result = tt_name_entry_ascii_from_utf16( rec, memory );
-            break;
-          }
-          
-        case TT_MS_ID_SYMBOL_CS:
-          {
-            result = tt_name_entry_ascii_from_other( rec, memory );
             break;
           }
           



reply via email to

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