Added function FT_Get_Name_Index, used to return a glyph index for a
given glyph name only if the driver supports glyph names.
This commit is contained in:
parent
3e92275489
commit
43f2a3f0f5
@ -1835,6 +1835,37 @@
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_UInt )
|
||||
FT_Get_Name_Index( FT_Face face,
|
||||
FT_String* glyph_name )
|
||||
{
|
||||
FT_UInt result = 0;
|
||||
|
||||
|
||||
if ( face && FT_HAS_GLYPH_NAMES( face ) )
|
||||
{
|
||||
/* now, lookup for glyph name */
|
||||
FT_Driver driver = face->driver;
|
||||
FT_Module_Class* clazz = FT_MODULE_CLASS( driver );
|
||||
|
||||
|
||||
if ( clazz->get_interface )
|
||||
{
|
||||
FT_Name_Index_Requester requester;
|
||||
|
||||
|
||||
requester = (FT_Name_Index_Requester)clazz->get_interface(
|
||||
FT_MODULE( driver ), "name_index" );
|
||||
if ( requester )
|
||||
result = requester( face, glyph_name );
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
|
Loading…
Reference in New Issue
Block a user