shithub: freetype+ttf2subf

Download patch

ref: d0841ea73badc69771413780ea6392eeed733dbd
parent: 9a87937522e8039958b659d1eac6d107531ca776
author: Werner Lemberg <[email protected]>
date: Mon Aug 27 02:57:05 EDT 2012

[autofit] Some macro and variable renamings for orthogonality.

* include/freetype/internal/autohint.h, src/base/ftobjs.c,
src/autofit/afmodule.c, src/autofit/afpic.c, src/autofit/afpic.h:
s/SERVICE/INTERFACE/, s/service/interface/, s/Service/Interface/.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-08-27  Werner Lemberg  <[email protected]>
+
+	[autofit] Some macro and variable renamings for orthogonality.
+
+	* include/freetype/internal/autohint.h, src/base/ftobjs.c,
+	src/autofit/afmodule.c, src/autofit/afpic.c, src/autofit/afpic.h:
+	s/SERVICE/INTERFACE/, s/service/interface/, s/Service/Interface/.
+
 2012-08-26  Werner Lemberg  <[email protected]>
 
 	Fix Savannah bug #37178.
--- a/include/freetype/internal/autohint.h
+++ b/include/freetype/internal/autohint.h
@@ -182,12 +182,12 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Struct>                                                              */
-  /*    FT_AutoHinter_ServiceRec                                           */
+  /*    FT_AutoHinter_InterfaceRec                                         */
   /*                                                                       */
   /* <Description>                                                         */
   /*    The auto-hinter module's interface.                                */
   /*                                                                       */
-  typedef struct  FT_AutoHinter_ServiceRec_
+  typedef struct  FT_AutoHinter_InterfaceRec_
   {
     FT_AutoHinter_GlobalResetFunc  reset_face;
     FT_AutoHinter_GlobalGetFunc    get_global_hints;
@@ -194,44 +194,44 @@
     FT_AutoHinter_GlobalDoneFunc   done_global_hints;
     FT_AutoHinter_GlyphLoadFunc    load_glyph;
 
-  } FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service;
+  } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
 
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_AUTOHINTER_SERVICE(       \
-          class_,                           \
-          reset_face_,                      \
-          get_global_hints_,                \
-          done_global_hints_,               \
-          load_glyph_ )                     \
-  FT_CALLBACK_TABLE_DEF                     \
-  const FT_AutoHinter_ServiceRec  class_ =  \
-  {                                         \
-    reset_face_,                            \
-    get_global_hints_,                      \
-    done_global_hints_,                     \
-    load_glyph_                             \
+#define FT_DEFINE_AUTOHINTER_INTERFACE(       \
+          class_,                             \
+          reset_face_,                        \
+          get_global_hints_,                  \
+          done_global_hints_,                 \
+          load_glyph_ )                       \
+  FT_CALLBACK_TABLE_DEF                       \
+  const FT_AutoHinter_InterfaceRec  class_ =  \
+  {                                           \
+    reset_face_,                              \
+    get_global_hints_,                        \
+    done_global_hints_,                       \
+    load_glyph_                               \
   };
 
 #else /* FT_CONFIG_OPTION_PIC */
 
-#define FT_DEFINE_AUTOHINTER_SERVICE(                            \
-          class_,                                                \
-          reset_face_,                                           \
-          get_global_hints_,                                     \
-          done_global_hints_,                                    \
-          load_glyph_ )                                          \
-  void                                                           \
-  FT_Init_Class_ ## class_( FT_Library                 library,  \
-                            FT_AutoHinter_ServiceRec*  clazz )   \
-  {                                                              \
-    FT_UNUSED( library );                                        \
-                                                                 \
-    clazz->reset_face        = reset_face_;                      \
-    clazz->get_global_hints  = get_global_hints_;                \
-    clazz->done_global_hints = done_global_hints_;               \
-    clazz->load_glyph        = load_glyph_;                      \
+#define FT_DEFINE_AUTOHINTER_INTERFACE(                            \
+          class_,                                                  \
+          reset_face_,                                             \
+          get_global_hints_,                                       \
+          done_global_hints_,                                      \
+          load_glyph_ )                                            \
+  void                                                             \
+  FT_Init_Class_ ## class_( FT_Library                   library,  \
+                            FT_AutoHinter_InterfaceRec*  clazz )   \
+  {                                                                \
+    FT_UNUSED( library );                                          \
+                                                                   \
+    clazz->reset_face        = reset_face_;                        \
+    clazz->get_global_hints  = get_global_hints_;                  \
+    clazz->done_global_hints = done_global_hints_;                 \
+    clazz->load_glyph        = load_glyph_;                        \
   }
 
 #endif /* FT_CONFIG_OPTION_PIC */
--- a/src/autofit/afmodule.c
+++ b/src/autofit/afmodule.c
@@ -66,13 +66,14 @@
   }
 
 
-  FT_DEFINE_AUTOHINTER_SERVICE(
-    af_autofitter_service,
+  FT_DEFINE_AUTOHINTER_INTERFACE(
+    af_autofitter_interface,
     NULL,                                                    /* reset_face */
     NULL,                                              /* get_global_hints */
     NULL,                                             /* done_global_hints */
     (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph )  /* load_glyph */
 
+
   FT_DEFINE_MODULE(
     autofit_module_class,
 
@@ -83,7 +84,7 @@
     0x10000L,   /* version 1.0 of the autofitter  */
     0x20000L,   /* requires FreeType 2.0 or above */
 
-    (const void*)&AF_AUTOFITTER_SERVICE_GET,
+    (const void*)&AF_AUTOFITTER_INTERFACE_GET,
 
     (FT_Module_Constructor)af_autofitter_init,
     (FT_Module_Destructor) af_autofitter_done,
--- a/src/autofit/afpic.c
+++ b/src/autofit/afpic.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for autofit module.  */
 /*                                                                         */
-/*  Copyright 2009, 2010, 2011 by                                          */
+/*  Copyright 2009-2012 by                                                 */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -22,12 +22,13 @@
 #include "afpic.h"
 #include "aferrors.h"
 
+
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from afmodule.c */
-  void FT_Init_Class_af_autofitter_service(
-    FT_Library                 library,
-    FT_AutoHinter_ServiceRec*  clazz );
+  void FT_Init_Class_af_autofitter_interface(
+    FT_Library                   library,
+    FT_AutoHinter_InterfaceRec*  clazz );
 
   /* forward declaration of PIC init functions from script classes */
 #include "aflatin.h"
@@ -38,6 +39,7 @@
 #include "afdummy.h"
 #include "afindic.h"
 
+
   void
   autofit_module_class_pic_free( FT_Library  library )
   {
@@ -93,8 +95,8 @@
     FT_Init_Class_af_indic_script_class(
       &container->af_script_classes_rec[ss++] );
 
-    FT_Init_Class_af_autofitter_service(
-      library, &container->af_autofitter_service );
+    FT_Init_Class_af_autofitter_interface(
+      library, &container->af_autofitter_interface );
 
 /* Exit: */
 
@@ -102,7 +104,6 @@
       autofit_module_class_pic_free( library );
     return error;
   }
-
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
--- a/src/autofit/afpic.h
+++ b/src/autofit/afpic.h
@@ -24,10 +24,11 @@
 
 #include FT_INTERNAL_PIC_H
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define AF_SCRIPT_CLASSES_GET      af_script_classes
-#define AF_AUTOFITTER_SERVICE_GET  af_autofitter_service
+#define AF_SCRIPT_CLASSES_GET        af_script_classes
+#define AF_AUTOFITTER_INTERFACE_GET  af_autofitter_interface
 
 #else /* FT_CONFIG_OPTION_PIC */
 
@@ -36,26 +37,31 @@
   /* increase these when you add new scripts, */
   /* and update autofit_module_class_pic_init */
 #ifdef FT_OPTION_AUTOFIT2
-#define AF_SCRIPT_CLASSES_COUNT     6
+#define AF_SCRIPT_CLASSES_COUNT  6
 #else
-#define AF_SCRIPT_CLASSES_COUNT     5
+#define AF_SCRIPT_CLASSES_COUNT  5
 #endif
+
 #define AF_SCRIPT_CLASSES_REC_COUNT  ( AF_SCRIPT_CLASSES_COUNT - 1 )
 
-  typedef struct AFModulePIC_
+
+  typedef struct  AFModulePIC_
   {
-    AF_ScriptClass            af_script_classes[AF_SCRIPT_CLASSES_COUNT];
-    AF_ScriptClassRec         af_script_classes_rec[AF_SCRIPT_CLASSES_REC_COUNT];
-    FT_AutoHinter_ServiceRec  af_autofitter_service;
+    AF_ScriptClass              af_script_classes[AF_SCRIPT_CLASSES_COUNT];
+    AF_ScriptClassRec           af_script_classes_rec[AF_SCRIPT_CLASSES_REC_COUNT];
+    FT_AutoHinter_InterfaceRec  af_autofitter_interface;
 
   } AFModulePIC;
 
+
 #define GET_PIC( lib )                                                     \
           ( (AFModulePIC*)((lib)->pic_container.autofit) )
+
 #define AF_SCRIPT_CLASSES_GET                                              \
           ( GET_PIC( FT_FACE_LIBRARY(globals->face) )->af_script_classes )
-#define AF_AUTOFITTER_SERVICE_GET                                          \
-          ( GET_PIC( library )->af_autofitter_service )
+#define AF_AUTOFITTER_INTERFACE_GET                                        \
+          ( GET_PIC( library )->af_autofitter_interface )
+
 
   /* see afpic.c for the implementation */
   void
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -651,7 +651,7 @@
 
     if ( autohint )
     {
-      FT_AutoHinter_Service  hinting;
+      FT_AutoHinter_Interface  hinting;
 
 
       /* try to load embedded bitmaps first if available            */
@@ -680,7 +680,7 @@
         internal->transform_flags = 0;
 
         /* load auto-hinted outline */
-        hinting = (FT_AutoHinter_Service)hinter->clazz->module_interface;
+        hinting = (FT_AutoHinter_Interface)hinter->clazz->module_interface;
 
         error   = hinting->load_glyph( (FT_AutoHinter)hinter,
                                        slot, face->size,