From ff2714feca7e31b4ced901ad1eebc655dc64b67f Mon Sep 17 00:00:00 2001 From: Tom Kacvinsky Date: Wed, 8 Aug 2001 10:58:08 +0000 Subject: [PATCH] Added function FT_Get_Name_Index, used to return a glyph index for a given glyph name only if the driver supports glyph names. --- src/base/ftobjs.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index e443f7e7c..c7454a57b 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -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 )