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.
This commit is contained in:
Werner Lemberg 2017-10-07 11:25:04 +02:00
parent f06456a82d
commit e23fe2adbc
5 changed files with 46 additions and 21 deletions

View File

@ -1,3 +1,16 @@
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.

View File

@ -63,6 +63,10 @@ FT_BEGIN_HEADER
FT_UInt num_coords,
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,
@ -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_; \
}

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */