1 /**************************************************************************** 2 * 3 * svmm.h 4 * 5 * The FreeType Multiple Masters and GX var services (specification). 6 * 7 * Copyright (C) 2003-2023 by 8 * David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches. 9 * 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. 15 * 16 */ 17 18 19 #ifndef SVMM_H_ 20 #define SVMM_H_ 21 22 #include <freetype/ftmm.h> 23 #include <freetype/internal/ftserv.h> 24 #include <freetype/internal/ftmmtypes.h> 25 26 27 FT_BEGIN_HEADER 28 29 30 /* 31 * A service used to manage multiple-masters data in a given face. 32 * 33 * See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H). 34 * 35 */ 36 37 #define FT_SERVICE_ID_MULTI_MASTERS "multi-masters" 38 39 40 typedef FT_Error 41 (*FT_Get_MM_Func)( FT_Face face, 42 FT_Multi_Master* master ); 43 44 typedef FT_Error 45 (*FT_Get_MM_Var_Func)( FT_Face face, 46 FT_MM_Var* *master ); 47 48 typedef FT_Error 49 (*FT_Set_MM_Design_Func)( FT_Face face, 50 FT_UInt num_coords, 51 FT_Long* coords ); 52 53 /* use return value -1 to indicate that the new coordinates */ 54 /* are equal to the current ones; no changes are thus needed */ 55 typedef FT_Error 56 (*FT_Set_Var_Design_Func)( FT_Face face, 57 FT_UInt num_coords, 58 FT_Fixed* coords ); 59 60 /* use return value -1 to indicate that the new coordinates */ 61 /* are equal to the current ones; no changes are thus needed */ 62 typedef FT_Error 63 (*FT_Set_MM_Blend_Func)( FT_Face face, 64 FT_UInt num_coords, 65 FT_Fixed* coords ); 66 67 typedef FT_Error 68 (*FT_Get_Var_Design_Func)( FT_Face face, 69 FT_UInt num_coords, 70 FT_Fixed* coords ); 71 72 typedef FT_Error 73 (*FT_Set_Named_Instance_Func)( FT_Face face, 74 FT_UInt instance_index ); 75 76 typedef FT_Error 77 (*FT_Get_Default_Named_Instance_Func)( FT_Face face, 78 FT_UInt *instance_index ); 79 80 typedef FT_Error 81 (*FT_Get_MM_Blend_Func)( FT_Face face, 82 FT_UInt num_coords, 83 FT_Fixed* coords ); 84 85 typedef FT_Error 86 (*FT_Get_Var_Blend_Func)( FT_Face face, 87 FT_UInt *num_coords, 88 FT_Fixed* *coords, 89 FT_Fixed* *normalizedcoords, 90 FT_MM_Var* *mm_var ); 91 92 typedef void 93 (*FT_Done_Blend_Func)( FT_Face face ); 94 95 typedef FT_Error 96 (*FT_Set_MM_WeightVector_Func)( FT_Face face, 97 FT_UInt len, 98 FT_Fixed* weight_vector ); 99 100 typedef FT_Error 101 (*FT_Get_MM_WeightVector_Func)( FT_Face face, 102 FT_UInt* len, 103 FT_Fixed* weight_vector ); 104 105 typedef void 106 (*FT_Construct_PS_Name_Func)( FT_Face face ); 107 108 typedef FT_Error 109 (*FT_Var_Load_Delta_Set_Idx_Map_Func)( FT_Face face, 110 FT_ULong offset, 111 GX_DeltaSetIdxMap map, 112 GX_ItemVarStore itemStore, 113 FT_ULong table_len ); 114 115 typedef FT_Error 116 (*FT_Var_Load_Item_Var_Store_Func)( FT_Face face, 117 FT_ULong offset, 118 GX_ItemVarStore itemStore ); 119 120 typedef FT_ItemVarDelta 121 (*FT_Var_Get_Item_Delta_Func)( FT_Face face, 122 GX_ItemVarStore itemStore, 123 FT_UInt outerIndex, 124 FT_UInt innerIndex ); 125 126 typedef void 127 (*FT_Var_Done_Item_Var_Store_Func)( FT_Face face, 128 GX_ItemVarStore itemStore ); 129 130 typedef void 131 (*FT_Var_Done_Delta_Set_Idx_Map_Func)( FT_Face face, 132 GX_DeltaSetIdxMap deltaSetIdxMap ); 133 134 FT_DEFINE_SERVICE(MultiMasters)135 FT_DEFINE_SERVICE( MultiMasters ) 136 { 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; 148 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; 158 }; 159 160 161 #define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \ 162 get_mm_, \ 163 set_mm_design_, \ 164 set_mm_blend_, \ 165 get_mm_blend_, \ 166 get_mm_var_, \ 167 set_var_design_, \ 168 get_var_design_, \ 169 set_named_instance_, \ 170 get_default_named_instance_, \ 171 set_mm_weightvector_, \ 172 get_mm_weightvector_, \ 173 \ 174 construct_ps_name_, \ 175 load_delta_set_idx_map_, \ 176 load_item_var_store_, \ 177 get_item_delta_, \ 178 done_item_var_store_, \ 179 done_delta_set_idx_map_, \ 180 get_var_blend_, \ 181 done_blend_ ) \ 182 static const FT_Service_MultiMastersRec class_ = \ 183 { \ 184 get_mm_, \ 185 set_mm_design_, \ 186 set_mm_blend_, \ 187 get_mm_blend_, \ 188 get_mm_var_, \ 189 set_var_design_, \ 190 get_var_design_, \ 191 set_named_instance_, \ 192 get_default_named_instance_, \ 193 set_mm_weightvector_, \ 194 get_mm_weightvector_, \ 195 \ 196 construct_ps_name_, \ 197 load_delta_set_idx_map_, \ 198 load_item_var_store_, \ 199 get_item_delta_, \ 200 done_item_var_store_, \ 201 done_delta_set_idx_map_, \ 202 get_var_blend_, \ 203 done_blend_ \ 204 }; 205 206 /* */ 207 208 209 FT_END_HEADER 210 211 #endif /* SVMM_H_ */ 212 213 214 /* END */ 215