|
|
|
@ -49,6 +49,15 @@ |
|
|
|
|
#include FT_SERVICE_SFNT_H |
|
|
|
|
#include FT_SERVICE_TT_CMAP_H |
|
|
|
|
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
/* */ |
|
|
|
|
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */ |
|
|
|
|
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ |
|
|
|
|
/* messages during execution. */ |
|
|
|
|
/* */ |
|
|
|
|
#undef FT_COMPONENT |
|
|
|
|
#define FT_COMPONENT trace_sfdriver |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* SFNT TABLE SERVICE |
|
|
|
@ -157,11 +166,19 @@ |
|
|
|
|
sfnt_get_name_index( TT_Face face, |
|
|
|
|
FT_String* glyph_name ) |
|
|
|
|
{ |
|
|
|
|
FT_Face root = &face->root; |
|
|
|
|
FT_Long i; |
|
|
|
|
FT_Face root = &face->root; |
|
|
|
|
FT_UInt i, max_gid = FT_UINT_MAX; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( root->num_glyphs < 0 ) |
|
|
|
|
return 0; |
|
|
|
|
else if ( ( FT_ULong ) root->num_glyphs < FT_UINT_MAX ) |
|
|
|
|
max_gid = ( FT_UInt ) root->num_glyphs; |
|
|
|
|
else |
|
|
|
|
FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08x\n", |
|
|
|
|
FT_UINT_MAX, root->num_glyphs )); |
|
|
|
|
|
|
|
|
|
for ( i = 0; i < root->num_glyphs; i++ ) |
|
|
|
|
for ( i = 0; i < max_gid; i++ ) |
|
|
|
|
{ |
|
|
|
|
FT_String* gname; |
|
|
|
|
FT_Error error = tt_face_get_ps_name( face, i, &gname ); |
|
|
|
@ -171,7 +188,7 @@ |
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
if ( !ft_strcmp( glyph_name, gname ) ) |
|
|
|
|
return (FT_UInt)i; |
|
|
|
|
return i; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|