1 /***************************************************************************/
5 /* FreeType Multiple Master font interface (specification). */
7 /* Copyright 1996-2015 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
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. */
16 /***************************************************************************/
24 #include FT_TYPE1_TABLES_H
30 /*************************************************************************/
33 /* multiple_masters */
36 /* Multiple Masters */
39 /* How to manage Multiple Masters fonts. */
42 /* The following types and functions are used to manage Multiple */
43 /* Master fonts, i.e., the selection of specific design instances by */
44 /* setting design axis coordinates. */
46 /* George Williams has extended this interface to make it work with */
47 /* both Type~1 Multiple Masters fonts and GX distortable (var) */
48 /* fonts. Some of these routines only work with MM fonts, others */
49 /* will work with both types. They are similar enough that a */
50 /* consistent interface makes sense. */
52 /*************************************************************************/
55 /*************************************************************************/
61 /* A simple structure used to model a given axis in design space for */
62 /* Multiple Masters fonts. */
64 /* This structure can't be used for GX var fonts. */
67 /* name :: The axis's name. */
69 /* minimum :: The axis's minimum design coordinate. */
71 /* maximum :: The axis's maximum design coordinate. */
73 typedef struct FT_MM_Axis_
82 /*************************************************************************/
88 /* A structure used to model the axes and space of a Multiple Masters */
91 /* This structure can't be used for GX var fonts. */
94 /* num_axis :: Number of axes. Cannot exceed~4. */
96 /* num_designs :: Number of designs; should be normally 2^num_axis */
97 /* even though the Type~1 specification strangely */
98 /* allows for intermediate designs to be present. */
99 /* This number cannot exceed~16. */
101 /* axis :: A table of axis descriptors. */
103 typedef struct FT_Multi_Master_
107 FT_MM_Axis axis
[T1_MAX_MM_AXIS
];
112 /*************************************************************************/
118 /* A simple structure used to model a given axis in design space for */
119 /* Multiple Masters and GX var fonts. */
122 /* name :: The axis's name. */
123 /* Not always meaningful for GX. */
125 /* minimum :: The axis's minimum design coordinate. */
127 /* def :: The axis's default design coordinate. */
128 /* FreeType computes meaningful default values for MM; it */
129 /* is then an integer value, not in 16.16 format. */
131 /* maximum :: The axis's maximum design coordinate. */
133 /* tag :: The axis's tag (the GX equivalent to `name'). */
134 /* FreeType provides default values for MM if possible. */
136 /* strid :: The entry in `name' table (another GX version of */
138 /* Not meaningful for MM. */
140 typedef struct FT_Var_Axis_
154 /*************************************************************************/
157 /* FT_Var_Named_Style */
160 /* A simple structure used to model a named style in a GX var font. */
162 /* This structure can't be used for MM fonts. */
165 /* coords :: The design coordinates for this style. */
166 /* This is an array with one entry for each axis. */
168 /* strid :: The entry in `name' table identifying this style. */
170 typedef struct FT_Var_Named_Style_
175 } FT_Var_Named_Style
;
178 /*************************************************************************/
184 /* A structure used to model the axes and space of a Multiple Masters */
185 /* or GX var distortable font. */
187 /* Some fields are specific to one format and not to the other. */
190 /* num_axis :: The number of axes. The maximum value is~4 for */
191 /* MM; no limit in GX. */
193 /* num_designs :: The number of designs; should be normally */
194 /* 2^num_axis for MM fonts. Not meaningful for GX */
195 /* (where every glyph could have a different */
196 /* number of designs). */
198 /* num_namedstyles :: The number of named styles; only meaningful for */
199 /* GX that allows certain design coordinates to */
200 /* have a string ID (in the `name' table) */
201 /* associated with them. The font can tell the */
202 /* user that, for example, Weight=1.5 is `Bold'. */
204 /* axis :: An axis descriptor table. */
205 /* GX fonts contain slightly more data than MM. */
207 /* namedstyle :: A named style table. */
208 /* Only meaningful with GX. */
210 typedef struct FT_MM_Var_
214 FT_UInt num_namedstyles
;
216 FT_Var_Named_Style
* namedstyle
;
221 /*************************************************************************/
224 /* FT_Get_Multi_Master */
227 /* Retrieve the Multiple Master descriptor of a given font. */
229 /* This function can't be used with GX fonts. */
232 /* face :: A handle to the source face. */
235 /* amaster :: The Multiple Masters descriptor. */
238 /* FreeType error code. 0~means success. */
240 FT_EXPORT( FT_Error
)
241 FT_Get_Multi_Master( FT_Face face
,
242 FT_Multi_Master
*amaster
);
245 /*************************************************************************/
251 /* Retrieve the Multiple Master/GX var descriptor of a given font. */
254 /* face :: A handle to the source face. */
257 /* amaster :: The Multiple Masters/GX var descriptor. */
258 /* Allocates a data structure, which the user must free. */
261 /* FreeType error code. 0~means success. */
263 FT_EXPORT( FT_Error
)
264 FT_Get_MM_Var( FT_Face face
,
265 FT_MM_Var
* *amaster
);
268 /*************************************************************************/
271 /* FT_Set_MM_Design_Coordinates */
274 /* For Multiple Masters fonts, choose an interpolated font design */
275 /* through design coordinates. */
277 /* This function can't be used with GX fonts. */
280 /* face :: A handle to the source face. */
283 /* num_coords :: The number of available design coordinates. If it */
284 /* is larger than the number of axes, ignore the excess */
285 /* values. If it is smaller than the number of axes, */
286 /* use default values for the remaining axes. */
288 /* coords :: An array of design coordinates. */
291 /* FreeType error code. 0~means success. */
293 FT_EXPORT( FT_Error
)
294 FT_Set_MM_Design_Coordinates( FT_Face face
,
299 /*************************************************************************/
302 /* FT_Set_Var_Design_Coordinates */
305 /* For Multiple Master or GX Var fonts, choose an interpolated font */
306 /* design through design coordinates. */
309 /* face :: A handle to the source face. */
312 /* num_coords :: The number of available design coordinates. If it */
313 /* is larger than the number of axes, ignore the excess */
314 /* values. If it is smaller than the number of axes, */
315 /* use default values for the remaining axes. */
317 /* coords :: An array of design coordinates. */
320 /* FreeType error code. 0~means success. */
322 FT_EXPORT( FT_Error
)
323 FT_Set_Var_Design_Coordinates( FT_Face face
,
328 /*************************************************************************/
331 /* FT_Set_MM_Blend_Coordinates */
334 /* For Multiple Masters and GX var fonts, choose an interpolated font */
335 /* design through normalized blend coordinates. */
338 /* face :: A handle to the source face. */
341 /* num_coords :: The number of available design coordinates. If it */
342 /* is larger than the number of axes, ignore the excess */
343 /* values. If it is smaller than the number of axes, */
344 /* use default values for the remaining axes. */
346 /* coords :: The design coordinates array (each element must be */
347 /* between 0 and 1.0). */
350 /* FreeType error code. 0~means success. */
352 FT_EXPORT( FT_Error
)
353 FT_Set_MM_Blend_Coordinates( FT_Face face
,
358 /*************************************************************************/
361 /* FT_Set_Var_Blend_Coordinates */
364 /* This is another name of @FT_Set_MM_Blend_Coordinates. */
366 FT_EXPORT( FT_Error
)
367 FT_Set_Var_Blend_Coordinates( FT_Face face
,
376 #endif /* __FTMM_H__ */