|
|
|
@ -111,6 +111,52 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char* |
|
|
|
|
get_sfnt_postscript_name( TT_Face face ) |
|
|
|
|
{ |
|
|
|
|
FT_Int n; |
|
|
|
|
|
|
|
|
|
/* shouldn't happen, but just in case to avoid memory leaks */
|
|
|
|
|
if ( face->root.internal->postscript_name ) |
|
|
|
|
return face->root.internal->postscript_name; |
|
|
|
|
|
|
|
|
|
/* scan the name table to see if we have a Postscript name here, either */ |
|
|
|
|
/* in Macintosh or Windows platform encodings.. */ |
|
|
|
|
for ( n = 0; n < face->num_names; n++ ) |
|
|
|
|
{ |
|
|
|
|
TT_NameRec* name = face->name_table.names + n; |
|
|
|
|
|
|
|
|
|
if ( name->nameID == 6 ) |
|
|
|
|
{ |
|
|
|
|
if ( ( name->platformID == 3 && |
|
|
|
|
name->encodingID == 1 && |
|
|
|
|
name->languageID == 0x409 ) || |
|
|
|
|
|
|
|
|
|
( name->platformID == 1 && |
|
|
|
|
name->encodingID == 0 && |
|
|
|
|
name->languageID == 0 ) ) |
|
|
|
|
{ |
|
|
|
|
FT_UInt len = name->stringLength; |
|
|
|
|
FT_Error error; |
|
|
|
|
FT_Memory memory = face->root.memory; |
|
|
|
|
FT_String* result; |
|
|
|
|
|
|
|
|
|
if ( !ALLOC( result, len+1 ) ) |
|
|
|
|
{ |
|
|
|
|
memcpy( result, name->string, len ); |
|
|
|
|
result[len] = '\0'; |
|
|
|
|
|
|
|
|
|
face->root.internal->postscript_name = result; |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -127,6 +173,10 @@ |
|
|
|
|
if ( strcmp( interface, "glyph_name" ) == 0 ) |
|
|
|
|
return (FT_Module_Interface)get_sfnt_glyph_name; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
if ( strcmp( interface, "postscript_name" ) == 0 ) |
|
|
|
|
return (FT_Module_Interface)get_sfnt_postscript_name; |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|