shithub: freetype+ttf2subf

Download patch

ref: 1cdac10d3a03d00b1355bd47e9bfacb9f1a990e9
parent: 6f91896980be09e5128c6fb09e541bf68a8c78e5
author: Werner Lemberg <[email protected]>
date: Tue Jul 7 10:04:44 EDT 2015

[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.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2015-07-07  Werner Lemberg  <[email protected]>
+
+	[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  <[email protected]>
 
 	Fix some clang compiler warnings.
--- a/include/freetype/internal/sfnt.h
+++ b/include/freetype/internal/sfnt.h
@@ -427,6 +427,33 @@
   /*************************************************************************/
   /*                                                                       */
   /* <FuncType>                                                            */
+  /*    TT_Get_Name_Func                                                   */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    From the `name' table, return a given ENGLISH name record in       */
+  /*    ASCII.                                                             */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    face     :: A handle to the source face object.                    */
+  /*                                                                       */
+  /*    nameid   :: The name id of the name record to return.              */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    name     :: The address of an allocated string pointer.  NULL if   */
+  /*                no name is present.                                    */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  typedef FT_Error
+  (*TT_Get_Name_Func)( TT_Face      face,
+                       FT_UShort    nameid,
+                       FT_String**  name );
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <FuncType>                                                            */
   /*    TT_Load_Table_Func                                                 */
   /*                                                                       */
   /* <Description>                                                         */
@@ -556,6 +583,8 @@
 
     TT_Get_Metrics_Func          get_metrics;
 
+    TT_Get_Name_Func             get_name;
+
   } SFNT_Interface;
 
 
@@ -594,7 +623,8 @@
           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 @@
     set_sbit_strike_,                    \
     load_strike_metrics_,                \
     get_metrics_,                        \
+    get_name_,                           \
   };
 
 #else /* FT_CONFIG_OPTION_PIC */
@@ -663,7 +694,8 @@
           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 @@
     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 */
--- 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
   )
 
 
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -120,27 +120,9 @@
                                                    FT_Memory     memory );
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    tt_face_get_name                                                   */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Returns a given ENGLISH name record in ASCII.                      */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face   :: A handle to the source face object.                      */
-  /*                                                                       */
-  /*    nameid :: The name id of the name record to return.                */
-  /*                                                                       */
-  /* <InOut>                                                               */
-  /*    name   :: The address of a string pointer.  NULL if no name is     */
-  /*              present.                                                 */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    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 )
--- a/src/sfnt/sfobjs.h
+++ b/src/sfnt/sfobjs.h
@@ -45,6 +45,11 @@
   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