shithub: freetype+ttf2subf

Download patch

ref: 27bdb36cbe02f6c62e09ec973c791e6565f9d38b
parent: 3205a44d01a1d676f218efd31d6104e8ca86ea05
author: Werner Lemberg <[email protected]>
date: Sat Dec 10 04:56:03 EST 2016

[truetype, type1] Add `done_blend' to MM service.

For internal use; we want to share code between the forthcoming CFF2
support and TrueType.

* include/freetype/internal/services/svmm.h (FT_Done_Blend_Func):
New typedef.
(MultiMasters): Add `done_blend'.
(FT_Service_MultiMasters): Updated.

* src/truetype/ttgxvar.c (tt_done_blend): Use `TT_Face' as argument.
* src/truetype/ttgxvar.h: Updated.

* src/truetype/ttobjs.c (TT_Face_Done): Updated.

* src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
* src/type1/t1driver.c (t1_service_multi_masters): Updated.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2016-12-10  Werner Lemberg  <[email protected]>
+
+	[truetype, type1] Add `done_blend' to MM service.
+
+	For internal use; we want to share code between the forthcoming CFF2
+	support and TrueType.
+
+	* include/freetype/internal/services/svmm.h (FT_Done_Blend_Func):
+	New typedef.
+	(MultiMasters): Add `done_blend'.
+	(FT_Service_MultiMasters): Updated.
+
+	* src/truetype/ttgxvar.c (tt_done_blend): Use `TT_Face' as argument.
+	* src/truetype/ttgxvar.h: Updated.
+
+	* src/truetype/ttobjs.c (TT_Face_Done): Updated.
+
+	* src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
+	* src/type1/t1driver.c (t1_service_multi_masters): Updated.
+
 2016-12-09  Werner Lemberg  <[email protected]>
 
 	[sfnt] Revert change from 2016-12-08.
--- a/include/freetype/internal/services/svmm.h
+++ b/include/freetype/internal/services/svmm.h
@@ -68,7 +68,10 @@
                            FT_UInt   num_coords,
                            FT_Long*  coords );
 
+  typedef void
+  (*FT_Done_Blend_Func)( FT_Face );
 
+
   FT_DEFINE_SERVICE( MultiMasters )
   {
     FT_Get_MM_Func          get_mm;
@@ -78,6 +81,9 @@
     FT_Get_MM_Var_Func      get_mm_var;
     FT_Set_Var_Design_Func  set_var_design;
     FT_Get_Var_Design_Func  get_var_design;
+
+    /* for internal use; only needed for code sharing between modules */
+    FT_Done_Blend_Func      done_blend;
   };
 
 
@@ -90,7 +96,8 @@
                                            get_mm_blend_,    \
                                            get_mm_var_,      \
                                            set_var_design_,  \
-                                           get_var_design_ ) \
+                                           get_var_design_,  \
+                                           done_blend_     ) \
   static const FT_Service_MultiMastersRec  class_ =          \
   {                                                          \
     get_mm_,                                                 \
@@ -99,7 +106,8 @@
     get_mm_blend_,                                           \
     get_mm_var_,                                             \
     set_var_design_,                                         \
-    get_var_design_                                          \
+    get_var_design_,                                         \
+    done_blend_                                              \
   };
 
 #else /* FT_CONFIG_OPTION_PIC */
@@ -111,7 +119,8 @@
                                            get_mm_blend_,        \
                                            get_mm_var_,          \
                                            set_var_design_,      \
-                                           get_var_design_ )     \
+                                           get_var_design_,      \
+                                           done_blend_ )         \
   void                                                           \
   FT_Init_Class_ ## class_( FT_Service_MultiMastersRec*  clazz ) \
   {                                                              \
@@ -122,6 +131,7 @@
     clazz->get_mm_var     = get_mm_var_;                         \
     clazz->set_var_design = set_var_design_;                     \
     clazz->get_var_design = get_var_design_;                     \
+    clazz->done_blend     = done_blend_;                         \
   }
 
 #endif /* FT_CONFIG_OPTION_PIC */
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -473,7 +473,9 @@
     (FT_Get_MM_Blend_Func)  TT_Get_MM_Blend,        /* get_mm_blend   */
     (FT_Get_MM_Var_Func)    TT_Get_MM_Var,          /* get_mm_var     */
     (FT_Set_Var_Design_Func)TT_Set_Var_Design,      /* set_var_design */
-    (FT_Get_Var_Design_Func)TT_Get_Var_Design       /* get_var_design */
+    (FT_Get_Var_Design_Func)TT_Get_Var_Design,      /* get_var_design */
+
+    (FT_Done_Blend_Func)    tt_done_blend           /* done_blend     */
   )
 #endif
 
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -2242,9 +2242,12 @@
   /*    Free the blend internal data structure.                            */
   /*                                                                       */
   FT_LOCAL_DEF( void )
-  tt_done_blend( FT_Memory  memory,
-                 GX_Blend   blend )
+  tt_done_blend( TT_Face  face )
   {
+    FT_Memory  memory = FT_FACE_MEMORY( face );
+    GX_Blend   blend  = face->blend;
+
+
     if ( blend != NULL )
     {
       FT_UInt  i, num_axes;
--- a/src/truetype/ttgxvar.h
+++ b/src/truetype/ttgxvar.h
@@ -180,8 +180,7 @@
 
 
   FT_LOCAL( void )
-  tt_done_blend( FT_Memory  memory,
-                 GX_Blend   blend );
+  tt_done_blend( TT_Face  face );
 
 
 FT_END_HEADER
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -739,7 +739,7 @@
     face->cvt_program_size  = 0;
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-    tt_done_blend( memory, face->blend );
+    tt_done_blend( face );
     face->blend = NULL;
 #endif
   }
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -125,7 +125,9 @@
     (FT_Get_MM_Blend_Func)  T1_Get_MM_Blend,       /* get_mm_blend   */
     (FT_Get_MM_Var_Func)    T1_Get_MM_Var,         /* get_mm_var     */
     (FT_Set_Var_Design_Func)T1_Set_Var_Design,     /* set_var_design */
-    (FT_Get_Var_Design_Func)T1_Get_Var_Design      /* get_var_design */
+    (FT_Get_Var_Design_Func)T1_Get_Var_Design,     /* get_var_design */
+
+    (FT_Done_Blend_Func)    T1_Done_Blend          /* done_blend     */
   };
 #endif