1 /****************************************************************************
5 * The FreeType Multiple Masters and GX var services (specification).
7 * Copyright (C) 2003-2023 by
8 * David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
10 * This file is part of the FreeType project, and may only be used,
11 * modified, and distributed under the terms of the FreeType project
12 * license, LICENSE.TXT. By continuing to use, modify, or distribute
13 * this file you indicate that you have read the license and
14 * understand and accept it fully.
22 #include <freetype/ftmm.h>
23 #include <freetype/internal/ftserv.h>
24 #include <freetype/internal/ftmmtypes.h>
31 * A service used to manage multiple-masters data in a given face.
33 * See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).
37 #define FT_SERVICE_ID_MULTI_MASTERS "multi-masters"
41 (*FT_Get_MM_Func)( FT_Face face,
42 FT_Multi_Master* master );
45 (*FT_Get_MM_Var_Func)( FT_Face face,
49 (*FT_Set_MM_Design_Func)( FT_Face face,
53 /* use return value -1 to indicate that the new coordinates */
54 /* are equal to the current ones; no changes are thus needed */
56 (*FT_Set_Var_Design_Func)( FT_Face face,
60 /* use return value -1 to indicate that the new coordinates */
61 /* are equal to the current ones; no changes are thus needed */
63 (*FT_Set_MM_Blend_Func)( FT_Face face,
68 (*FT_Get_Var_Design_Func)( FT_Face face,
73 (*FT_Set_Named_Instance_Func)( FT_Face face,
74 FT_UInt instance_index );
77 (*FT_Get_Default_Named_Instance_Func)( FT_Face face,
78 FT_UInt *instance_index );
81 (*FT_Get_MM_Blend_Func)( FT_Face face,
86 (*FT_Get_Var_Blend_Func)( FT_Face face,
89 FT_Fixed* *normalizedcoords,
93 (*FT_Done_Blend_Func)( FT_Face face );
96 (*FT_Set_MM_WeightVector_Func)( FT_Face face,
98 FT_Fixed* weight_vector );
101 (*FT_Get_MM_WeightVector_Func)( FT_Face face,
103 FT_Fixed* weight_vector );
106 (*FT_Construct_PS_Name_Func)( FT_Face face );
109 (*FT_Var_Load_Delta_Set_Idx_Map_Func)( FT_Face face,
111 GX_DeltaSetIdxMap map,
112 GX_ItemVarStore itemStore,
113 FT_ULong table_len );
116 (*FT_Var_Load_Item_Var_Store_Func)( FT_Face face,
118 GX_ItemVarStore itemStore );
120 typedef FT_ItemVarDelta
121 (*FT_Var_Get_Item_Delta_Func)( FT_Face face,
122 GX_ItemVarStore itemStore,
124 FT_UInt innerIndex );
127 (*FT_Var_Done_Item_Var_Store_Func)( FT_Face face,
128 GX_ItemVarStore itemStore );
131 (*FT_Var_Done_Delta_Set_Idx_Map_Func)( FT_Face face,
132 GX_DeltaSetIdxMap deltaSetIdxMap );
135 FT_DEFINE_SERVICE( MultiMasters )
137 FT_Get_MM_Func get_mm;
138 FT_Set_MM_Design_Func set_mm_design;
139 FT_Set_MM_Blend_Func set_mm_blend;
140 FT_Get_MM_Blend_Func get_mm_blend;
141 FT_Get_MM_Var_Func get_mm_var;
142 FT_Set_Var_Design_Func set_var_design;
143 FT_Get_Var_Design_Func get_var_design;
144 FT_Set_Named_Instance_Func set_named_instance;
145 FT_Get_Default_Named_Instance_Func get_default_named_instance;
146 FT_Set_MM_WeightVector_Func set_mm_weightvector;
147 FT_Get_MM_WeightVector_Func get_mm_weightvector;
149 /* for internal use; only needed for code sharing between modules */
150 FT_Construct_PS_Name_Func construct_ps_name;
151 FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map;
152 FT_Var_Load_Item_Var_Store_Func load_item_var_store;
153 FT_Var_Get_Item_Delta_Func get_item_delta;
154 FT_Var_Done_Item_Var_Store_Func done_item_var_store;
155 FT_Var_Done_Delta_Set_Idx_Map_Func done_delta_set_idx_map;
156 FT_Get_Var_Blend_Func get_var_blend;
157 FT_Done_Blend_Func done_blend;
161 #define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
169 set_named_instance_, \
170 get_default_named_instance_, \
171 set_mm_weightvector_, \
172 get_mm_weightvector_, \
174 construct_ps_name_, \
175 load_delta_set_idx_map_, \
176 load_item_var_store_, \
178 done_item_var_store_, \
179 done_delta_set_idx_map_, \
182 static const FT_Service_MultiMastersRec class_ = \
191 set_named_instance_, \
192 get_default_named_instance_, \
193 set_mm_weightvector_, \
194 get_mm_weightvector_, \
196 construct_ps_name_, \
197 load_delta_set_idx_map_, \
198 load_item_var_store_, \
200 done_item_var_store_, \
201 done_delta_set_idx_map_, \