diff options
author | George Williams <gww@silcom.com> | 2002-06-21 02:07:48 +0000 |
---|---|---|
committer | George Williams <gww@silcom.com> | 2002-06-21 02:07:48 +0000 |
commit | 1bf190fcb4b89c54f71d9b69d2ff4e9267340a71 (patch) | |
tree | 97633ffdbb3463c38587efe1d7893dc860987df7 | |
parent | c9dcc8577e0a39967eb98b7c83dc0ebad656e458 (diff) |
Oops. We did not look for apple names in sfnt resources. Most likely case. So
all too often ttf files would be called "Untitled-n".ttf
-rw-r--r-- | fondu.c | 27 |
1 files changed, 19 insertions, 8 deletions
@@ -511,13 +511,15 @@ return(false); val = 0; if ( plat==0 && /* any unicode semantics will do && */ lang==0 ) val = 1; - else if ( plat==3 && spec==1 && lang==0x409 ) + else if ( plat==3 && spec==1 && lang==0x409 ) /* MS Name */ val = 2; + else if ( plat==1 && spec==0 ) /* Apple name */ + val = 3; if ( name==4 && val>fullval ) { fullval = val; fullstr = off; fulllen = len; - if ( val==2 ) + if ( val==2 || val==3 ) break; } else if ( name==1 && val>famval ) { famval = val; @@ -534,12 +536,21 @@ return( false ); fseek(ttf,stringoffset+fullstr,SEEK_SET); pt = buffer; - for ( i=0; i<len/2; ++i ) { - /* Ignore high unicode byte */ getc(ttf)/*<<8*/; - ch = getc(ttf); - /* avoid characters that are hard to manipulate on the command line */ - if ( ch>'!' && ch!='*' && ch!='?' && ch!='/' && ch!='\\' && ch<0x7f ) - *pt++ = ch; + if ( val==3 ) { + for ( i=0; i<len; ++i ) { + ch = getc(ttf); + /* avoid characters that are hard to manipulate on the command line */ + if ( ch>'!' && ch!='*' && ch!='?' && ch!='/' && ch!='\\' && ch<0x7f ) + *pt++ = ch; + } + } else { + for ( i=0; i<len/2; ++i ) { + /* Ignore high unicode byte */ getc(ttf)/*<<8*/; + ch = getc(ttf); + /* avoid characters that are hard to manipulate on the command line */ + if ( ch>'!' && ch!='*' && ch!='?' && ch!='/' && ch!='\\' && ch<0x7f ) + *pt++ = ch; + } } strcpy(pt,isotf?".otf":".ttf"); return( true ); |