diff options
author | Werner Lemberg <wl@gnu.org> | 2017-10-07 11:25:04 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2017-10-07 11:25:04 +0200 |
commit | e23fe2adbcdbd7019a62a4775bcece1b22c76641 (patch) | |
tree | 277cc8c2ef6a89793574468fd95fdc4618ee0b73 | |
parent | f06456a82d5751d637a7e2cea21e4c71d2c8d2db (diff) | |
download | freetype2-e23fe2adbcdbd7019a62a4775bcece1b22c76641.tar.gz |
Add framework for setting named instance in MM service.
* include/freetype/internal/services/svmm.h (FT_Set_Instance_Func):
New function typedef.
(MultiMasters): Add `set_instance' member.
(FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
* src/cff/cffdrivr.c (cff_service_multi_masters),
src/truetype/ttdriver (tt_service_gx_multi_masters),
src/type1/t1driver.c (t1_service_multi_masters): Updated.
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | include/freetype/internal/services/svmm.h | 51 | ||||
-rw-r--r-- | src/cff/cffdrivr.c | 1 | ||||
-rw-r--r-- | src/truetype/ttdriver.c | 1 | ||||
-rw-r--r-- | src/type1/t1driver.c | 1 |
5 files changed, 46 insertions, 21 deletions
@@ -1,5 +1,18 @@ 2017-10-07 Werner Lemberg <wl@gnu.org> + Add framework for setting named instance in MM service. + + * include/freetype/internal/services/svmm.h (FT_Set_Instance_Func): + New function typedef. + (MultiMasters): Add `set_instance' member. + (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. + + * src/cff/cffdrivr.c (cff_service_multi_masters), + src/truetype/ttdriver (tt_service_gx_multi_masters), + src/type1/t1driver.c (t1_service_multi_masters): Updated. + +2017-10-07 Werner Lemberg <wl@gnu.org> + [type1] Minor code shuffling. * src/type1/t1load.c (T1_Set_MM_Blend): Make it a wrapper of... diff --git a/include/freetype/internal/services/svmm.h b/include/freetype/internal/services/svmm.h index 1d51cd909..a934f9452 100644 --- a/include/freetype/internal/services/svmm.h +++ b/include/freetype/internal/services/svmm.h @@ -64,6 +64,10 @@ FT_BEGIN_HEADER FT_Fixed* coords ); typedef FT_Error + (*FT_Set_Instance_Func)( FT_Face face, + FT_UInt instance_index ); + + typedef FT_Error (*FT_Get_MM_Blend_Func)( FT_Face face, FT_UInt num_coords, FT_Long* coords ); @@ -88,6 +92,7 @@ FT_BEGIN_HEADER FT_Get_MM_Var_Func get_mm_var; FT_Set_Var_Design_Func set_var_design; FT_Get_Var_Design_Func get_var_design; + FT_Set_Instance_Func set_instance; /* for internal use; only needed for code sharing between modules */ FT_Get_Var_Blend_Func get_var_blend; @@ -97,27 +102,29 @@ FT_BEGIN_HEADER #ifndef FT_CONFIG_OPTION_PIC -#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \ - get_mm_, \ - set_mm_design_, \ - set_mm_blend_, \ - get_mm_blend_, \ - get_mm_var_, \ - set_var_design_, \ - get_var_design_, \ - get_var_blend_, \ - done_blend_ ) \ - static const FT_Service_MultiMastersRec class_ = \ - { \ - get_mm_, \ - set_mm_design_, \ - set_mm_blend_, \ - get_mm_blend_, \ - get_mm_var_, \ - set_var_design_, \ - get_var_design_, \ - get_var_blend_, \ - done_blend_ \ +#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \ + get_mm_, \ + set_mm_design_, \ + set_mm_blend_, \ + get_mm_blend_, \ + get_mm_var_, \ + set_var_design_, \ + get_var_design_, \ + set_instance_, \ + get_var_blend_, \ + done_blend_ ) \ + static const FT_Service_MultiMastersRec class_ = \ + { \ + get_mm_, \ + set_mm_design_, \ + set_mm_blend_, \ + get_mm_blend_, \ + get_mm_var_, \ + set_var_design_, \ + get_var_design_, \ + set_instance_, \ + get_var_blend_, \ + done_blend_ \ }; #else /* FT_CONFIG_OPTION_PIC */ @@ -130,6 +137,7 @@ FT_BEGIN_HEADER get_mm_var_, \ set_var_design_, \ get_var_design_, \ + set_instance_, \ get_var_blend_, \ done_blend_ ) \ void \ @@ -142,6 +150,7 @@ FT_BEGIN_HEADER clazz->get_mm_var = get_mm_var_; \ clazz->set_var_design = set_var_design_; \ clazz->get_var_design = get_var_design_; \ + clazz->set_instance = set_instance_; \ clazz->get_var_blend = get_var_blend_; \ clazz->done_blend = done_blend_; \ } diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c index 906d315c9..3cecbc0d7 100644 --- a/src/cff/cffdrivr.c +++ b/src/cff/cffdrivr.c @@ -1119,6 +1119,7 @@ (FT_Get_MM_Var_Func) cff_get_mm_var, /* get_mm_var */ (FT_Set_Var_Design_Func)cff_set_var_design, /* set_var_design */ (FT_Get_Var_Design_Func)cff_get_var_design, /* get_var_design */ + (FT_Set_Instance_Func) NULL, /* set_instance */ (FT_Get_Var_Blend_Func) cff_get_var_blend, /* get_var_blend */ (FT_Done_Blend_Func) cff_done_blend /* done_blend */ diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c index a1653b241..22bb87282 100644 --- a/src/truetype/ttdriver.c +++ b/src/truetype/ttdriver.c @@ -498,6 +498,7 @@ (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_Set_Instance_Func) NULL, /* set_instance */ (FT_Get_Var_Blend_Func) tt_get_var_blend, /* get_var_blend */ (FT_Done_Blend_Func) tt_done_blend /* done_blend */ diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c index 866a8244d..b319f566d 100644 --- a/src/type1/t1driver.c +++ b/src/type1/t1driver.c @@ -126,6 +126,7 @@ (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_Set_Instance_Func) NULL, /* set_instance */ (FT_Get_Var_Blend_Func) NULL, /* get_var_blend */ (FT_Done_Blend_Func) T1_Done_Blend /* done_blend */ |