diff --git a/ChangeLog b/ChangeLog index 11b206458..76375f554 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2015-07-07 Werner Lemberg + + [sfnt] Make `tt_face_get_name' member of the SFNT interface. + + * include/freetype/internal/sfnt.h (TT_Get_Name_Func): New + prototype. + (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): New member `get_name'. + + * src/sfnt/sfdriver.c (sfnt_interface): Updated. + + * src/sfnt/sfobjs.c (tt_face_get_name): Tag it with `LOCAL_DEF'. + * src/sfnt/sfobjs.h: Add prototype for it. + 2015-06-30 Werner Lemberg Fix some clang compiler warnings. diff --git a/include/freetype/internal/sfnt.h b/include/freetype/internal/sfnt.h index 97ce390c3..bcaa3a0fb 100644 --- a/include/freetype/internal/sfnt.h +++ b/include/freetype/internal/sfnt.h @@ -424,6 +424,33 @@ FT_BEGIN_HEADER FT_UShort* aadvance ); + /*************************************************************************/ + /* */ + /* */ + /* TT_Get_Name_Func */ + /* */ + /* */ + /* From the `name' table, return a given ENGLISH name record in */ + /* ASCII. */ + /* */ + /* */ + /* face :: A handle to the source face object. */ + /* */ + /* nameid :: The name id of the name record to return. */ + /* */ + /* */ + /* name :: The address of an allocated string pointer. NULL if */ + /* no name is present. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + typedef FT_Error + (*TT_Get_Name_Func)( TT_Face face, + FT_UShort nameid, + FT_String** name ); + + /*************************************************************************/ /* */ /* */ @@ -556,6 +583,8 @@ FT_BEGIN_HEADER TT_Get_Metrics_Func get_metrics; + TT_Get_Name_Func get_name; + } SFNT_Interface; @@ -594,7 +623,8 @@ FT_BEGIN_HEADER free_eblc_, \ set_sbit_strike_, \ load_strike_metrics_, \ - get_metrics_ ) \ + get_metrics_, \ + get_name_ ) \ static const SFNT_Interface class_ = \ { \ goto_table_, \ @@ -626,6 +656,7 @@ FT_BEGIN_HEADER set_sbit_strike_, \ load_strike_metrics_, \ get_metrics_, \ + get_name_, \ }; #else /* FT_CONFIG_OPTION_PIC */ @@ -663,7 +694,8 @@ FT_BEGIN_HEADER free_eblc_, \ set_sbit_strike_, \ load_strike_metrics_, \ - get_metrics_ ) \ + get_metrics_, \ + get_name_ ) \ void \ FT_Init_Class_ ## class_( FT_Library library, \ SFNT_Interface* clazz ) \ @@ -699,6 +731,7 @@ FT_BEGIN_HEADER clazz->set_sbit_strike = set_sbit_strike_; \ clazz->load_strike_metrics = load_strike_metrics_; \ clazz->get_metrics = get_metrics_; \ + clazz->get_name = get_name_; \ } #endif /* FT_CONFIG_OPTION_PIC */ diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c index 0948ad4e7..6a3f0d993 100644 --- a/src/sfnt/sfdriver.c +++ b/src/sfnt/sfdriver.c @@ -505,7 +505,9 @@ PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike ), PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ), - tt_face_get_metrics + tt_face_get_metrics, + + tt_face_get_name ) diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 40c27fa9a..9a4ec1f83 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -120,27 +120,9 @@ FT_Memory memory ); - /*************************************************************************/ - /* */ - /* */ - /* tt_face_get_name */ - /* */ - /* */ - /* Returns a given ENGLISH name record in ASCII. */ - /* */ - /* */ - /* face :: A handle to the source face object. */ - /* */ - /* nameid :: The name id of the name record to return. */ - /* */ - /* */ - /* name :: The address of a string pointer. NULL if no name is */ - /* present. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error + /* documentation is in sfnt.h */ + + FT_LOCAL_DEF( FT_Error ) tt_face_get_name( TT_Face face, FT_UShort nameid, FT_String** name ) diff --git a/src/sfnt/sfobjs.h b/src/sfnt/sfobjs.h index 77c7d92c3..323780d8b 100644 --- a/src/sfnt/sfobjs.h +++ b/src/sfnt/sfobjs.h @@ -45,6 +45,11 @@ FT_BEGIN_HEADER FT_LOCAL( void ) sfnt_done_face( TT_Face face ); + FT_LOCAL( FT_Error ) + tt_face_get_name( TT_Face face, + FT_UShort nameid, + FT_String** name ); + FT_END_HEADER