rev |
line source |
nuclear@0
|
1 /***************************************************************************/
|
nuclear@0
|
2 /* */
|
nuclear@0
|
3 /* ftmm.h */
|
nuclear@0
|
4 /* */
|
nuclear@0
|
5 /* FreeType Multiple Master font interface (specification). */
|
nuclear@0
|
6 /* */
|
nuclear@0
|
7 /* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
|
nuclear@0
|
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
nuclear@0
|
9 /* */
|
nuclear@0
|
10 /* This file is part of the FreeType project, and may only be used, */
|
nuclear@0
|
11 /* modified, and distributed under the terms of the FreeType project */
|
nuclear@0
|
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
nuclear@0
|
13 /* this file you indicate that you have read the license and */
|
nuclear@0
|
14 /* understand and accept it fully. */
|
nuclear@0
|
15 /* */
|
nuclear@0
|
16 /***************************************************************************/
|
nuclear@0
|
17
|
nuclear@0
|
18
|
nuclear@0
|
19 #ifndef __FTMM_H__
|
nuclear@0
|
20 #define __FTMM_H__
|
nuclear@0
|
21
|
nuclear@0
|
22
|
nuclear@0
|
23 #include <ft2build.h>
|
nuclear@0
|
24 #include FT_TYPE1_TABLES_H
|
nuclear@0
|
25
|
nuclear@0
|
26
|
nuclear@0
|
27 FT_BEGIN_HEADER
|
nuclear@0
|
28
|
nuclear@0
|
29
|
nuclear@0
|
30 /*************************************************************************/
|
nuclear@0
|
31 /* */
|
nuclear@0
|
32 /* <Section> */
|
nuclear@0
|
33 /* multiple_masters */
|
nuclear@0
|
34 /* */
|
nuclear@0
|
35 /* <Title> */
|
nuclear@0
|
36 /* Multiple Masters */
|
nuclear@0
|
37 /* */
|
nuclear@0
|
38 /* <Abstract> */
|
nuclear@0
|
39 /* How to manage Multiple Masters fonts. */
|
nuclear@0
|
40 /* */
|
nuclear@0
|
41 /* <Description> */
|
nuclear@0
|
42 /* The following types and functions are used to manage Multiple */
|
nuclear@0
|
43 /* Master fonts, i.e., the selection of specific design instances by */
|
nuclear@0
|
44 /* setting design axis coordinates. */
|
nuclear@0
|
45 /* */
|
nuclear@0
|
46 /* George Williams has extended this interface to make it work with */
|
nuclear@0
|
47 /* both Type~1 Multiple Masters fonts and GX distortable (var) */
|
nuclear@0
|
48 /* fonts. Some of these routines only work with MM fonts, others */
|
nuclear@0
|
49 /* will work with both types. They are similar enough that a */
|
nuclear@0
|
50 /* consistent interface makes sense. */
|
nuclear@0
|
51 /* */
|
nuclear@0
|
52 /*************************************************************************/
|
nuclear@0
|
53
|
nuclear@0
|
54
|
nuclear@0
|
55 /*************************************************************************/
|
nuclear@0
|
56 /* */
|
nuclear@0
|
57 /* <Struct> */
|
nuclear@0
|
58 /* FT_MM_Axis */
|
nuclear@0
|
59 /* */
|
nuclear@0
|
60 /* <Description> */
|
nuclear@0
|
61 /* A simple structure used to model a given axis in design space for */
|
nuclear@0
|
62 /* Multiple Masters fonts. */
|
nuclear@0
|
63 /* */
|
nuclear@0
|
64 /* This structure can't be used for GX var fonts. */
|
nuclear@0
|
65 /* */
|
nuclear@0
|
66 /* <Fields> */
|
nuclear@0
|
67 /* name :: The axis's name. */
|
nuclear@0
|
68 /* */
|
nuclear@0
|
69 /* minimum :: The axis's minimum design coordinate. */
|
nuclear@0
|
70 /* */
|
nuclear@0
|
71 /* maximum :: The axis's maximum design coordinate. */
|
nuclear@0
|
72 /* */
|
nuclear@0
|
73 typedef struct FT_MM_Axis_
|
nuclear@0
|
74 {
|
nuclear@0
|
75 FT_String* name;
|
nuclear@0
|
76 FT_Long minimum;
|
nuclear@0
|
77 FT_Long maximum;
|
nuclear@0
|
78
|
nuclear@0
|
79 } FT_MM_Axis;
|
nuclear@0
|
80
|
nuclear@0
|
81
|
nuclear@0
|
82 /*************************************************************************/
|
nuclear@0
|
83 /* */
|
nuclear@0
|
84 /* <Struct> */
|
nuclear@0
|
85 /* FT_Multi_Master */
|
nuclear@0
|
86 /* */
|
nuclear@0
|
87 /* <Description> */
|
nuclear@0
|
88 /* A structure used to model the axes and space of a Multiple Masters */
|
nuclear@0
|
89 /* font. */
|
nuclear@0
|
90 /* */
|
nuclear@0
|
91 /* This structure can't be used for GX var fonts. */
|
nuclear@0
|
92 /* */
|
nuclear@0
|
93 /* <Fields> */
|
nuclear@0
|
94 /* num_axis :: Number of axes. Cannot exceed~4. */
|
nuclear@0
|
95 /* */
|
nuclear@0
|
96 /* num_designs :: Number of designs; should be normally 2^num_axis */
|
nuclear@0
|
97 /* even though the Type~1 specification strangely */
|
nuclear@0
|
98 /* allows for intermediate designs to be present. This */
|
nuclear@0
|
99 /* number cannot exceed~16. */
|
nuclear@0
|
100 /* */
|
nuclear@0
|
101 /* axis :: A table of axis descriptors. */
|
nuclear@0
|
102 /* */
|
nuclear@0
|
103 typedef struct FT_Multi_Master_
|
nuclear@0
|
104 {
|
nuclear@0
|
105 FT_UInt num_axis;
|
nuclear@0
|
106 FT_UInt num_designs;
|
nuclear@0
|
107 FT_MM_Axis axis[T1_MAX_MM_AXIS];
|
nuclear@0
|
108
|
nuclear@0
|
109 } FT_Multi_Master;
|
nuclear@0
|
110
|
nuclear@0
|
111
|
nuclear@0
|
112 /*************************************************************************/
|
nuclear@0
|
113 /* */
|
nuclear@0
|
114 /* <Struct> */
|
nuclear@0
|
115 /* FT_Var_Axis */
|
nuclear@0
|
116 /* */
|
nuclear@0
|
117 /* <Description> */
|
nuclear@0
|
118 /* A simple structure used to model a given axis in design space for */
|
nuclear@0
|
119 /* Multiple Masters and GX var fonts. */
|
nuclear@0
|
120 /* */
|
nuclear@0
|
121 /* <Fields> */
|
nuclear@0
|
122 /* name :: The axis's name. */
|
nuclear@0
|
123 /* Not always meaningful for GX. */
|
nuclear@0
|
124 /* */
|
nuclear@0
|
125 /* minimum :: The axis's minimum design coordinate. */
|
nuclear@0
|
126 /* */
|
nuclear@0
|
127 /* def :: The axis's default design coordinate. */
|
nuclear@0
|
128 /* FreeType computes meaningful default values for MM; it */
|
nuclear@0
|
129 /* is then an integer value, not in 16.16 format. */
|
nuclear@0
|
130 /* */
|
nuclear@0
|
131 /* maximum :: The axis's maximum design coordinate. */
|
nuclear@0
|
132 /* */
|
nuclear@0
|
133 /* tag :: The axis's tag (the GX equivalent to `name'). */
|
nuclear@0
|
134 /* FreeType provides default values for MM if possible. */
|
nuclear@0
|
135 /* */
|
nuclear@0
|
136 /* strid :: The entry in `name' table (another GX version of */
|
nuclear@0
|
137 /* `name'). */
|
nuclear@0
|
138 /* Not meaningful for MM. */
|
nuclear@0
|
139 /* */
|
nuclear@0
|
140 typedef struct FT_Var_Axis_
|
nuclear@0
|
141 {
|
nuclear@0
|
142 FT_String* name;
|
nuclear@0
|
143
|
nuclear@0
|
144 FT_Fixed minimum;
|
nuclear@0
|
145 FT_Fixed def;
|
nuclear@0
|
146 FT_Fixed maximum;
|
nuclear@0
|
147
|
nuclear@0
|
148 FT_ULong tag;
|
nuclear@0
|
149 FT_UInt strid;
|
nuclear@0
|
150
|
nuclear@0
|
151 } FT_Var_Axis;
|
nuclear@0
|
152
|
nuclear@0
|
153
|
nuclear@0
|
154 /*************************************************************************/
|
nuclear@0
|
155 /* */
|
nuclear@0
|
156 /* <Struct> */
|
nuclear@0
|
157 /* FT_Var_Named_Style */
|
nuclear@0
|
158 /* */
|
nuclear@0
|
159 /* <Description> */
|
nuclear@0
|
160 /* A simple structure used to model a named style in a GX var font. */
|
nuclear@0
|
161 /* */
|
nuclear@0
|
162 /* This structure can't be used for MM fonts. */
|
nuclear@0
|
163 /* */
|
nuclear@0
|
164 /* <Fields> */
|
nuclear@0
|
165 /* coords :: The design coordinates for this style. */
|
nuclear@0
|
166 /* This is an array with one entry for each axis. */
|
nuclear@0
|
167 /* */
|
nuclear@0
|
168 /* strid :: The entry in `name' table identifying this style. */
|
nuclear@0
|
169 /* */
|
nuclear@0
|
170 typedef struct FT_Var_Named_Style_
|
nuclear@0
|
171 {
|
nuclear@0
|
172 FT_Fixed* coords;
|
nuclear@0
|
173 FT_UInt strid;
|
nuclear@0
|
174
|
nuclear@0
|
175 } FT_Var_Named_Style;
|
nuclear@0
|
176
|
nuclear@0
|
177
|
nuclear@0
|
178 /*************************************************************************/
|
nuclear@0
|
179 /* */
|
nuclear@0
|
180 /* <Struct> */
|
nuclear@0
|
181 /* FT_MM_Var */
|
nuclear@0
|
182 /* */
|
nuclear@0
|
183 /* <Description> */
|
nuclear@0
|
184 /* A structure used to model the axes and space of a Multiple Masters */
|
nuclear@0
|
185 /* or GX var distortable font. */
|
nuclear@0
|
186 /* */
|
nuclear@0
|
187 /* Some fields are specific to one format and not to the other. */
|
nuclear@0
|
188 /* */
|
nuclear@0
|
189 /* <Fields> */
|
nuclear@0
|
190 /* num_axis :: The number of axes. The maximum value is~4 for */
|
nuclear@0
|
191 /* MM; no limit in GX. */
|
nuclear@0
|
192 /* */
|
nuclear@0
|
193 /* num_designs :: The number of designs; should be normally */
|
nuclear@0
|
194 /* 2^num_axis for MM fonts. Not meaningful for GX */
|
nuclear@0
|
195 /* (where every glyph could have a different */
|
nuclear@0
|
196 /* number of designs). */
|
nuclear@0
|
197 /* */
|
nuclear@0
|
198 /* num_namedstyles :: The number of named styles; only meaningful for */
|
nuclear@0
|
199 /* GX which allows certain design coordinates to */
|
nuclear@0
|
200 /* have a string ID (in the `name' table) */
|
nuclear@0
|
201 /* associated with them. The font can tell the */
|
nuclear@0
|
202 /* user that, for example, Weight=1.5 is `Bold'. */
|
nuclear@0
|
203 /* */
|
nuclear@0
|
204 /* axis :: A table of axis descriptors. */
|
nuclear@0
|
205 /* GX fonts contain slightly more data than MM. */
|
nuclear@0
|
206 /* */
|
nuclear@0
|
207 /* namedstyles :: A table of named styles. */
|
nuclear@0
|
208 /* Only meaningful with GX. */
|
nuclear@0
|
209 /* */
|
nuclear@0
|
210 typedef struct FT_MM_Var_
|
nuclear@0
|
211 {
|
nuclear@0
|
212 FT_UInt num_axis;
|
nuclear@0
|
213 FT_UInt num_designs;
|
nuclear@0
|
214 FT_UInt num_namedstyles;
|
nuclear@0
|
215 FT_Var_Axis* axis;
|
nuclear@0
|
216 FT_Var_Named_Style* namedstyle;
|
nuclear@0
|
217
|
nuclear@0
|
218 } FT_MM_Var;
|
nuclear@0
|
219
|
nuclear@0
|
220
|
nuclear@0
|
221 /* */
|
nuclear@0
|
222
|
nuclear@0
|
223
|
nuclear@0
|
224 /*************************************************************************/
|
nuclear@0
|
225 /* */
|
nuclear@0
|
226 /* <Function> */
|
nuclear@0
|
227 /* FT_Get_Multi_Master */
|
nuclear@0
|
228 /* */
|
nuclear@0
|
229 /* <Description> */
|
nuclear@0
|
230 /* Retrieve the Multiple Master descriptor of a given font. */
|
nuclear@0
|
231 /* */
|
nuclear@0
|
232 /* This function can't be used with GX fonts. */
|
nuclear@0
|
233 /* */
|
nuclear@0
|
234 /* <Input> */
|
nuclear@0
|
235 /* face :: A handle to the source face. */
|
nuclear@0
|
236 /* */
|
nuclear@0
|
237 /* <Output> */
|
nuclear@0
|
238 /* amaster :: The Multiple Masters descriptor. */
|
nuclear@0
|
239 /* */
|
nuclear@0
|
240 /* <Return> */
|
nuclear@0
|
241 /* FreeType error code. 0~means success. */
|
nuclear@0
|
242 /* */
|
nuclear@0
|
243 FT_EXPORT( FT_Error )
|
nuclear@0
|
244 FT_Get_Multi_Master( FT_Face face,
|
nuclear@0
|
245 FT_Multi_Master *amaster );
|
nuclear@0
|
246
|
nuclear@0
|
247
|
nuclear@0
|
248 /*************************************************************************/
|
nuclear@0
|
249 /* */
|
nuclear@0
|
250 /* <Function> */
|
nuclear@0
|
251 /* FT_Get_MM_Var */
|
nuclear@0
|
252 /* */
|
nuclear@0
|
253 /* <Description> */
|
nuclear@0
|
254 /* Retrieve the Multiple Master/GX var descriptor of a given font. */
|
nuclear@0
|
255 /* */
|
nuclear@0
|
256 /* <Input> */
|
nuclear@0
|
257 /* face :: A handle to the source face. */
|
nuclear@0
|
258 /* */
|
nuclear@0
|
259 /* <Output> */
|
nuclear@0
|
260 /* amaster :: The Multiple Masters/GX var descriptor. */
|
nuclear@0
|
261 /* Allocates a data structure, which the user must free */
|
nuclear@0
|
262 /* (a single call to FT_FREE will do it). */
|
nuclear@0
|
263 /* */
|
nuclear@0
|
264 /* <Return> */
|
nuclear@0
|
265 /* FreeType error code. 0~means success. */
|
nuclear@0
|
266 /* */
|
nuclear@0
|
267 FT_EXPORT( FT_Error )
|
nuclear@0
|
268 FT_Get_MM_Var( FT_Face face,
|
nuclear@0
|
269 FT_MM_Var* *amaster );
|
nuclear@0
|
270
|
nuclear@0
|
271
|
nuclear@0
|
272 /*************************************************************************/
|
nuclear@0
|
273 /* */
|
nuclear@0
|
274 /* <Function> */
|
nuclear@0
|
275 /* FT_Set_MM_Design_Coordinates */
|
nuclear@0
|
276 /* */
|
nuclear@0
|
277 /* <Description> */
|
nuclear@0
|
278 /* For Multiple Masters fonts, choose an interpolated font design */
|
nuclear@0
|
279 /* through design coordinates. */
|
nuclear@0
|
280 /* */
|
nuclear@0
|
281 /* This function can't be used with GX fonts. */
|
nuclear@0
|
282 /* */
|
nuclear@0
|
283 /* <InOut> */
|
nuclear@0
|
284 /* face :: A handle to the source face. */
|
nuclear@0
|
285 /* */
|
nuclear@0
|
286 /* <Input> */
|
nuclear@0
|
287 /* num_coords :: The number of design coordinates (must be equal to */
|
nuclear@0
|
288 /* the number of axes in the font). */
|
nuclear@0
|
289 /* */
|
nuclear@0
|
290 /* coords :: An array of design coordinates. */
|
nuclear@0
|
291 /* */
|
nuclear@0
|
292 /* <Return> */
|
nuclear@0
|
293 /* FreeType error code. 0~means success. */
|
nuclear@0
|
294 /* */
|
nuclear@0
|
295 FT_EXPORT( FT_Error )
|
nuclear@0
|
296 FT_Set_MM_Design_Coordinates( FT_Face face,
|
nuclear@0
|
297 FT_UInt num_coords,
|
nuclear@0
|
298 FT_Long* coords );
|
nuclear@0
|
299
|
nuclear@0
|
300
|
nuclear@0
|
301 /*************************************************************************/
|
nuclear@0
|
302 /* */
|
nuclear@0
|
303 /* <Function> */
|
nuclear@0
|
304 /* FT_Set_Var_Design_Coordinates */
|
nuclear@0
|
305 /* */
|
nuclear@0
|
306 /* <Description> */
|
nuclear@0
|
307 /* For Multiple Master or GX Var fonts, choose an interpolated font */
|
nuclear@0
|
308 /* design through design coordinates. */
|
nuclear@0
|
309 /* */
|
nuclear@0
|
310 /* <InOut> */
|
nuclear@0
|
311 /* face :: A handle to the source face. */
|
nuclear@0
|
312 /* */
|
nuclear@0
|
313 /* <Input> */
|
nuclear@0
|
314 /* num_coords :: The number of design coordinates (must be equal to */
|
nuclear@0
|
315 /* the number of axes in the font). */
|
nuclear@0
|
316 /* */
|
nuclear@0
|
317 /* coords :: An array of design coordinates. */
|
nuclear@0
|
318 /* */
|
nuclear@0
|
319 /* <Return> */
|
nuclear@0
|
320 /* FreeType error code. 0~means success. */
|
nuclear@0
|
321 /* */
|
nuclear@0
|
322 FT_EXPORT( FT_Error )
|
nuclear@0
|
323 FT_Set_Var_Design_Coordinates( FT_Face face,
|
nuclear@0
|
324 FT_UInt num_coords,
|
nuclear@0
|
325 FT_Fixed* coords );
|
nuclear@0
|
326
|
nuclear@0
|
327
|
nuclear@0
|
328 /*************************************************************************/
|
nuclear@0
|
329 /* */
|
nuclear@0
|
330 /* <Function> */
|
nuclear@0
|
331 /* FT_Set_MM_Blend_Coordinates */
|
nuclear@0
|
332 /* */
|
nuclear@0
|
333 /* <Description> */
|
nuclear@0
|
334 /* For Multiple Masters and GX var fonts, choose an interpolated font */
|
nuclear@0
|
335 /* design through normalized blend coordinates. */
|
nuclear@0
|
336 /* */
|
nuclear@0
|
337 /* <InOut> */
|
nuclear@0
|
338 /* face :: A handle to the source face. */
|
nuclear@0
|
339 /* */
|
nuclear@0
|
340 /* <Input> */
|
nuclear@0
|
341 /* num_coords :: The number of design coordinates (must be equal to */
|
nuclear@0
|
342 /* the number of axes in the font). */
|
nuclear@0
|
343 /* */
|
nuclear@0
|
344 /* coords :: The design coordinates array (each element must be */
|
nuclear@0
|
345 /* between 0 and 1.0). */
|
nuclear@0
|
346 /* */
|
nuclear@0
|
347 /* <Return> */
|
nuclear@0
|
348 /* FreeType error code. 0~means success. */
|
nuclear@0
|
349 /* */
|
nuclear@0
|
350 FT_EXPORT( FT_Error )
|
nuclear@0
|
351 FT_Set_MM_Blend_Coordinates( FT_Face face,
|
nuclear@0
|
352 FT_UInt num_coords,
|
nuclear@0
|
353 FT_Fixed* coords );
|
nuclear@0
|
354
|
nuclear@0
|
355
|
nuclear@0
|
356 /*************************************************************************/
|
nuclear@0
|
357 /* */
|
nuclear@0
|
358 /* <Function> */
|
nuclear@0
|
359 /* FT_Set_Var_Blend_Coordinates */
|
nuclear@0
|
360 /* */
|
nuclear@0
|
361 /* <Description> */
|
nuclear@0
|
362 /* This is another name of @FT_Set_MM_Blend_Coordinates. */
|
nuclear@0
|
363 /* */
|
nuclear@0
|
364 FT_EXPORT( FT_Error )
|
nuclear@0
|
365 FT_Set_Var_Blend_Coordinates( FT_Face face,
|
nuclear@0
|
366 FT_UInt num_coords,
|
nuclear@0
|
367 FT_Fixed* coords );
|
nuclear@0
|
368
|
nuclear@0
|
369
|
nuclear@0
|
370 /* */
|
nuclear@0
|
371
|
nuclear@0
|
372
|
nuclear@0
|
373 FT_END_HEADER
|
nuclear@0
|
374
|
nuclear@0
|
375 #endif /* __FTMM_H__ */
|
nuclear@0
|
376
|
nuclear@0
|
377
|
nuclear@0
|
378 /* END */
|