25 |
25 |
26 |
26 |
27 FT_BEGIN_HEADER |
27 FT_BEGIN_HEADER |
28 |
28 |
29 |
29 |
30 /*************************************************************************/ |
30 /************************************************************************** |
31 /* */ |
31 * |
32 /* <Section> */ |
32 * @section: |
33 /* multiple_masters */ |
33 * multiple_masters |
34 /* */ |
34 * |
35 /* <Title> */ |
35 * @title: |
36 /* Multiple Masters */ |
36 * Multiple Masters |
37 /* */ |
37 * |
38 /* <Abstract> */ |
38 * @abstract: |
39 /* How to manage Multiple Masters fonts. */ |
39 * How to manage Multiple Masters fonts. |
40 /* */ |
40 * |
41 /* <Description> */ |
41 * @description: |
42 /* The following types and functions are used to manage Multiple */ |
42 * The following types and functions are used to manage Multiple Master |
43 /* Master fonts, i.e., the selection of specific design instances by */ |
43 * fonts, i.e., the selection of specific design instances by setting |
44 /* setting design axis coordinates. */ |
44 * design axis coordinates. |
45 /* */ |
45 * |
46 /* Besides Adobe MM fonts, the interface supports Apple's TrueType GX */ |
46 * Besides Adobe MM fonts, the interface supports Apple's TrueType GX and |
47 /* and OpenType variation fonts. Some of the routines only work with */ |
47 * OpenType variation fonts. Some of the routines only work with Adobe |
48 /* Adobe MM fonts, others will work with all three types. They are */ |
48 * MM fonts, others will work with all three types. They are similar |
49 /* similar enough that a consistent interface makes sense. */ |
49 * enough that a consistent interface makes sense. |
50 /* */ |
50 * |
51 /*************************************************************************/ |
51 */ |
52 |
52 |
53 |
53 |
54 /*************************************************************************/ |
54 /************************************************************************** |
55 /* */ |
55 * |
56 /* <Struct> */ |
56 * @struct: |
57 /* FT_MM_Axis */ |
57 * FT_MM_Axis |
58 /* */ |
58 * |
59 /* <Description> */ |
59 * @description: |
60 /* A structure to model a given axis in design space for Multiple */ |
60 * A structure to model a given axis in design space for Multiple Masters |
61 /* Masters fonts. */ |
61 * fonts. |
62 /* */ |
62 * |
63 /* This structure can't be used for TrueType GX or OpenType variation */ |
63 * This structure can't be used for TrueType GX or OpenType variation |
64 /* fonts. */ |
64 * fonts. |
65 /* */ |
65 * |
66 /* <Fields> */ |
66 * @fields: |
67 /* name :: The axis's name. */ |
67 * name :: |
68 /* */ |
68 * The axis's name. |
69 /* minimum :: The axis's minimum design coordinate. */ |
69 * |
70 /* */ |
70 * minimum :: |
71 /* maximum :: The axis's maximum design coordinate. */ |
71 * The axis's minimum design coordinate. |
72 /* */ |
72 * |
|
73 * maximum :: |
|
74 * The axis's maximum design coordinate. |
|
75 */ |
73 typedef struct FT_MM_Axis_ |
76 typedef struct FT_MM_Axis_ |
74 { |
77 { |
75 FT_String* name; |
78 FT_String* name; |
76 FT_Long minimum; |
79 FT_Long minimum; |
77 FT_Long maximum; |
80 FT_Long maximum; |
78 |
81 |
79 } FT_MM_Axis; |
82 } FT_MM_Axis; |
80 |
83 |
81 |
84 |
82 /*************************************************************************/ |
85 /************************************************************************** |
83 /* */ |
86 * |
84 /* <Struct> */ |
87 * @struct: |
85 /* FT_Multi_Master */ |
88 * FT_Multi_Master |
86 /* */ |
89 * |
87 /* <Description> */ |
90 * @description: |
88 /* A structure to model the axes and space of a Multiple Masters */ |
91 * A structure to model the axes and space of a Multiple Masters font. |
89 /* font. */ |
92 * |
90 /* */ |
93 * This structure can't be used for TrueType GX or OpenType variation |
91 /* This structure can't be used for TrueType GX or OpenType variation */ |
94 * fonts. |
92 /* fonts. */ |
95 * |
93 /* */ |
96 * @fields: |
94 /* <Fields> */ |
97 * num_axis :: |
95 /* num_axis :: Number of axes. Cannot exceed~4. */ |
98 * Number of axes. Cannot exceed~4. |
96 /* */ |
99 * |
97 /* num_designs :: Number of designs; should be normally 2^num_axis */ |
100 * num_designs :: |
98 /* even though the Type~1 specification strangely */ |
101 * Number of designs; should be normally 2^num_axis even though the |
99 /* allows for intermediate designs to be present. */ |
102 * Type~1 specification strangely allows for intermediate designs to be |
100 /* This number cannot exceed~16. */ |
103 * present. This number cannot exceed~16. |
101 /* */ |
104 * |
102 /* axis :: A table of axis descriptors. */ |
105 * axis :: |
103 /* */ |
106 * A table of axis descriptors. |
|
107 */ |
104 typedef struct FT_Multi_Master_ |
108 typedef struct FT_Multi_Master_ |
105 { |
109 { |
106 FT_UInt num_axis; |
110 FT_UInt num_axis; |
107 FT_UInt num_designs; |
111 FT_UInt num_designs; |
108 FT_MM_Axis axis[T1_MAX_MM_AXIS]; |
112 FT_MM_Axis axis[T1_MAX_MM_AXIS]; |
109 |
113 |
110 } FT_Multi_Master; |
114 } FT_Multi_Master; |
111 |
115 |
112 |
116 |
113 /*************************************************************************/ |
117 /************************************************************************** |
114 /* */ |
118 * |
115 /* <Struct> */ |
119 * @struct: |
116 /* FT_Var_Axis */ |
120 * FT_Var_Axis |
117 /* */ |
121 * |
118 /* <Description> */ |
122 * @description: |
119 /* A structure to model a given axis in design space for Multiple */ |
123 * A structure to model a given axis in design space for Multiple |
120 /* Masters, TrueType GX, and OpenType variation fonts. */ |
124 * Masters, TrueType GX, and OpenType variation fonts. |
121 /* */ |
125 * |
122 /* <Fields> */ |
126 * @fields: |
123 /* name :: The axis's name. */ |
127 * name :: |
124 /* Not always meaningful for TrueType GX or OpenType */ |
128 * The axis's name. Not always meaningful for TrueType GX or OpenType |
125 /* variation fonts. */ |
129 * variation fonts. |
126 /* */ |
130 * |
127 /* minimum :: The axis's minimum design coordinate. */ |
131 * minimum :: |
128 /* */ |
132 * The axis's minimum design coordinate. |
129 /* def :: The axis's default design coordinate. */ |
133 * |
130 /* FreeType computes meaningful default values for Adobe */ |
134 * def :: |
131 /* MM fonts. */ |
135 * The axis's default design coordinate. FreeType computes meaningful |
132 /* */ |
136 * default values for Adobe MM fonts. |
133 /* maximum :: The axis's maximum design coordinate. */ |
137 * |
134 /* */ |
138 * maximum :: |
135 /* tag :: The axis's tag (the equivalent to `name' for TrueType */ |
139 * The axis's maximum design coordinate. |
136 /* GX and OpenType variation fonts). FreeType provides */ |
140 * |
137 /* default values for Adobe MM fonts if possible. */ |
141 * tag :: |
138 /* */ |
142 * The axis's tag (the equivalent to 'name' for TrueType GX and |
139 /* strid :: The axis name entry in the font's `name' table. This */ |
143 * OpenType variation fonts). FreeType provides default values for |
140 /* is another (and often better) version of the `name' */ |
144 * Adobe MM fonts if possible. |
141 /* field for TrueType GX or OpenType variation fonts. Not */ |
145 * |
142 /* meaningful for Adobe MM fonts. */ |
146 * strid :: |
143 /* */ |
147 * The axis name entry in the font's 'name' table. This is another |
144 /* <Note> */ |
148 * (and often better) version of the 'name' field for TrueType GX or |
145 /* The fields `minimum', `def', and `maximum' are 16.16 fractional */ |
149 * OpenType variation fonts. Not meaningful for Adobe MM fonts. |
146 /* values for TrueType GX and OpenType variation fonts. For Adobe MM */ |
150 * |
147 /* fonts, the values are integers. */ |
151 * @note: |
148 /* */ |
152 * The fields `minimum`, `def`, and `maximum` are 16.16 fractional values |
|
153 * for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the |
|
154 * values are integers. |
|
155 */ |
149 typedef struct FT_Var_Axis_ |
156 typedef struct FT_Var_Axis_ |
150 { |
157 { |
151 FT_String* name; |
158 FT_String* name; |
152 |
159 |
153 FT_Fixed minimum; |
160 FT_Fixed minimum; |
158 FT_UInt strid; |
165 FT_UInt strid; |
159 |
166 |
160 } FT_Var_Axis; |
167 } FT_Var_Axis; |
161 |
168 |
162 |
169 |
163 /*************************************************************************/ |
170 /************************************************************************** |
164 /* */ |
171 * |
165 /* <Struct> */ |
172 * @struct: |
166 /* FT_Var_Named_Style */ |
173 * FT_Var_Named_Style |
167 /* */ |
174 * |
168 /* <Description> */ |
175 * @description: |
169 /* A structure to model a named instance in a TrueType GX or OpenType */ |
176 * A structure to model a named instance in a TrueType GX or OpenType |
170 /* variation font. */ |
177 * variation font. |
171 /* */ |
178 * |
172 /* This structure can't be used for Adobe MM fonts. */ |
179 * This structure can't be used for Adobe MM fonts. |
173 /* */ |
180 * |
174 /* <Fields> */ |
181 * @fields: |
175 /* coords :: The design coordinates for this instance. */ |
182 * coords :: |
176 /* This is an array with one entry for each axis. */ |
183 * The design coordinates for this instance. This is an array with one |
177 /* */ |
184 * entry for each axis. |
178 /* strid :: The entry in `name' table identifying this instance. */ |
185 * |
179 /* */ |
186 * strid :: |
180 /* psid :: The entry in `name' table identifying a PostScript name */ |
187 * The entry in 'name' table identifying this instance. |
181 /* for this instance. Value 0xFFFF indicates a missing */ |
188 * |
182 /* entry. */ |
189 * psid :: |
183 /* */ |
190 * The entry in 'name' table identifying a PostScript name for this |
|
191 * instance. Value 0xFFFF indicates a missing entry. |
|
192 */ |
184 typedef struct FT_Var_Named_Style_ |
193 typedef struct FT_Var_Named_Style_ |
185 { |
194 { |
186 FT_Fixed* coords; |
195 FT_Fixed* coords; |
187 FT_UInt strid; |
196 FT_UInt strid; |
188 FT_UInt psid; /* since 2.7.1 */ |
197 FT_UInt psid; /* since 2.7.1 */ |
189 |
198 |
190 } FT_Var_Named_Style; |
199 } FT_Var_Named_Style; |
191 |
200 |
192 |
201 |
193 /*************************************************************************/ |
202 /************************************************************************** |
194 /* */ |
203 * |
195 /* <Struct> */ |
204 * @struct: |
196 /* FT_MM_Var */ |
205 * FT_MM_Var |
197 /* */ |
206 * |
198 /* <Description> */ |
207 * @description: |
199 /* A structure to model the axes and space of an Adobe MM, TrueType */ |
208 * A structure to model the axes and space of an Adobe MM, TrueType GX, |
200 /* GX, or OpenType variation font. */ |
209 * or OpenType variation font. |
201 /* */ |
210 * |
202 /* Some fields are specific to one format and not to the others. */ |
211 * Some fields are specific to one format and not to the others. |
203 /* */ |
212 * |
204 /* <Fields> */ |
213 * @fields: |
205 /* num_axis :: The number of axes. The maximum value is~4 for */ |
214 * num_axis :: |
206 /* Adobe MM fonts; no limit in TrueType GX or */ |
215 * The number of axes. The maximum value is~4 for Adobe MM fonts; no |
207 /* OpenType variation fonts. */ |
216 * limit in TrueType GX or OpenType variation fonts. |
208 /* */ |
217 * |
209 /* num_designs :: The number of designs; should be normally */ |
218 * num_designs :: |
210 /* 2^num_axis for Adobe MM fonts. Not meaningful */ |
219 * The number of designs; should be normally 2^num_axis for Adobe MM |
211 /* for TrueType GX or OpenType variation fonts */ |
220 * fonts. Not meaningful for TrueType GX or OpenType variation fonts |
212 /* (where every glyph could have a different */ |
221 * (where every glyph could have a different number of designs). |
213 /* number of designs). */ |
222 * |
214 /* */ |
223 * num_namedstyles :: |
215 /* num_namedstyles :: The number of named styles; a `named style' is */ |
224 * The number of named styles; a 'named style' is a tuple of design |
216 /* a tuple of design coordinates that has a string */ |
225 * coordinates that has a string ID (in the 'name' table) associated |
217 /* ID (in the `name' table) associated with it. */ |
226 * with it. The font can tell the user that, for example, |
218 /* The font can tell the user that, for example, */ |
227 * [Weight=1.5,Width=1.1] is 'Bold'. Another name for 'named style' is |
219 /* [Weight=1.5,Width=1.1] is `Bold'. Another name */ |
228 * 'named instance'. |
220 /* for `named style' is `named instance'. */ |
229 * |
221 /* */ |
230 * For Adobe Multiple Masters fonts, this value is always zero because |
222 /* For Adobe Multiple Masters fonts, this value is */ |
231 * the format does not support named styles. |
223 /* always zero because the format does not support */ |
232 * |
224 /* named styles. */ |
233 * axis :: |
225 /* */ |
234 * An axis descriptor table. TrueType GX and OpenType variation fonts |
226 /* axis :: An axis descriptor table. */ |
235 * contain slightly more data than Adobe MM fonts. Memory management |
227 /* TrueType GX and OpenType variation fonts */ |
236 * of this pointer is done internally by FreeType. |
228 /* contain slightly more data than Adobe MM fonts. */ |
237 * |
229 /* Memory management of this pointer is done */ |
238 * namedstyle :: |
230 /* internally by FreeType. */ |
239 * A named style (instance) table. Only meaningful for TrueType GX and |
231 /* */ |
240 * OpenType variation fonts. Memory management of this pointer is done |
232 /* namedstyle :: A named style (instance) table. */ |
241 * internally by FreeType. |
233 /* Only meaningful for TrueType GX and OpenType */ |
242 */ |
234 /* variation fonts. Memory management of this */ |
|
235 /* pointer is done internally by FreeType. */ |
|
236 /* */ |
|
237 typedef struct FT_MM_Var_ |
243 typedef struct FT_MM_Var_ |
238 { |
244 { |
239 FT_UInt num_axis; |
245 FT_UInt num_axis; |
240 FT_UInt num_designs; |
246 FT_UInt num_designs; |
241 FT_UInt num_namedstyles; |
247 FT_UInt num_namedstyles; |
243 FT_Var_Named_Style* namedstyle; |
249 FT_Var_Named_Style* namedstyle; |
244 |
250 |
245 } FT_MM_Var; |
251 } FT_MM_Var; |
246 |
252 |
247 |
253 |
248 /*************************************************************************/ |
254 /************************************************************************** |
249 /* */ |
255 * |
250 /* <Function> */ |
256 * @function: |
251 /* FT_Get_Multi_Master */ |
257 * FT_Get_Multi_Master |
252 /* */ |
258 * |
253 /* <Description> */ |
259 * @description: |
254 /* Retrieve a variation descriptor of a given Adobe MM font. */ |
260 * Retrieve a variation descriptor of a given Adobe MM font. |
255 /* */ |
261 * |
256 /* This function can't be used with TrueType GX or OpenType variation */ |
262 * This function can't be used with TrueType GX or OpenType variation |
257 /* fonts. */ |
263 * fonts. |
258 /* */ |
264 * |
259 /* <Input> */ |
265 * @input: |
260 /* face :: A handle to the source face. */ |
266 * face :: |
261 /* */ |
267 * A handle to the source face. |
262 /* <Output> */ |
268 * |
263 /* amaster :: The Multiple Masters descriptor. */ |
269 * @output: |
264 /* */ |
270 * amaster :: |
265 /* <Return> */ |
271 * The Multiple Masters descriptor. |
266 /* FreeType error code. 0~means success. */ |
272 * |
267 /* */ |
273 * @return: |
|
274 * FreeType error code. 0~means success. |
|
275 */ |
268 FT_EXPORT( FT_Error ) |
276 FT_EXPORT( FT_Error ) |
269 FT_Get_Multi_Master( FT_Face face, |
277 FT_Get_Multi_Master( FT_Face face, |
270 FT_Multi_Master *amaster ); |
278 FT_Multi_Master *amaster ); |
271 |
279 |
272 |
280 |
273 /*************************************************************************/ |
281 /************************************************************************** |
274 /* */ |
282 * |
275 /* <Function> */ |
283 * @function: |
276 /* FT_Get_MM_Var */ |
284 * FT_Get_MM_Var |
277 /* */ |
285 * |
278 /* <Description> */ |
286 * @description: |
279 /* Retrieve a variation descriptor for a given font. */ |
287 * Retrieve a variation descriptor for a given font. |
280 /* */ |
288 * |
281 /* This function works with all supported variation formats. */ |
289 * This function works with all supported variation formats. |
282 /* */ |
290 * |
283 /* <Input> */ |
291 * @input: |
284 /* face :: A handle to the source face. */ |
292 * face :: |
285 /* */ |
293 * A handle to the source face. |
286 /* <Output> */ |
294 * |
287 /* amaster :: The variation descriptor. */ |
295 * @output: |
288 /* Allocates a data structure, which the user must */ |
296 * amaster :: |
289 /* deallocate with a call to @FT_Done_MM_Var after use. */ |
297 * The variation descriptor. Allocates a data structure, which the |
290 /* */ |
298 * user must deallocate with a call to @FT_Done_MM_Var after use. |
291 /* <Return> */ |
299 * |
292 /* FreeType error code. 0~means success. */ |
300 * @return: |
293 /* */ |
301 * FreeType error code. 0~means success. |
|
302 */ |
294 FT_EXPORT( FT_Error ) |
303 FT_EXPORT( FT_Error ) |
295 FT_Get_MM_Var( FT_Face face, |
304 FT_Get_MM_Var( FT_Face face, |
296 FT_MM_Var* *amaster ); |
305 FT_MM_Var* *amaster ); |
297 |
306 |
298 |
307 |
299 /*************************************************************************/ |
308 /************************************************************************** |
300 /* */ |
309 * |
301 /* <Function> */ |
310 * @function: |
302 /* FT_Done_MM_Var */ |
311 * FT_Done_MM_Var |
303 /* */ |
312 * |
304 /* <Description> */ |
313 * @description: |
305 /* Free the memory allocated by @FT_Get_MM_Var. */ |
314 * Free the memory allocated by @FT_Get_MM_Var. |
306 /* */ |
315 * |
307 /* <Input> */ |
316 * @input: |
308 /* library :: A handle of the face's parent library object that was */ |
317 * library :: |
309 /* used in the call to @FT_Get_MM_Var to create `amaster'. */ |
318 * A handle of the face's parent library object that was used in the |
310 /* */ |
319 * call to @FT_Get_MM_Var to create `amaster`. |
311 /* <Return> */ |
320 * |
312 /* FreeType error code. 0~means success. */ |
321 * @return: |
313 /* */ |
322 * FreeType error code. 0~means success. |
|
323 */ |
314 FT_EXPORT( FT_Error ) |
324 FT_EXPORT( FT_Error ) |
315 FT_Done_MM_Var( FT_Library library, |
325 FT_Done_MM_Var( FT_Library library, |
316 FT_MM_Var *amaster ); |
326 FT_MM_Var *amaster ); |
317 |
327 |
318 |
328 |
319 /*************************************************************************/ |
329 /************************************************************************** |
320 /* */ |
330 * |
321 /* <Function> */ |
331 * @function: |
322 /* FT_Set_MM_Design_Coordinates */ |
332 * FT_Set_MM_Design_Coordinates |
323 /* */ |
333 * |
324 /* <Description> */ |
334 * @description: |
325 /* For Adobe MM fonts, choose an interpolated font design through */ |
335 * For Adobe MM fonts, choose an interpolated font design through design |
326 /* design coordinates. */ |
336 * coordinates. |
327 /* */ |
337 * |
328 /* This function can't be used with TrueType GX or OpenType variation */ |
338 * This function can't be used with TrueType GX or OpenType variation |
329 /* fonts. */ |
339 * fonts. |
330 /* */ |
340 * |
331 /* <InOut> */ |
341 * @inout: |
332 /* face :: A handle to the source face. */ |
342 * face :: |
333 /* */ |
343 * A handle to the source face. |
334 /* <Input> */ |
344 * |
335 /* num_coords :: The number of available design coordinates. If it */ |
345 * @input: |
336 /* is larger than the number of axes, ignore the excess */ |
346 * num_coords :: |
337 /* values. If it is smaller than the number of axes, */ |
347 * The number of available design coordinates. If it is larger than |
338 /* use default values for the remaining axes. */ |
348 * the number of axes, ignore the excess values. If it is smaller than |
339 /* */ |
349 * the number of axes, use default values for the remaining axes. |
340 /* coords :: An array of design coordinates. */ |
350 * |
341 /* */ |
351 * coords :: |
342 /* <Return> */ |
352 * An array of design coordinates. |
343 /* FreeType error code. 0~means success. */ |
353 * |
344 /* */ |
354 * @return: |
345 /* <Note> */ |
355 * FreeType error code. 0~means success. |
346 /* [Since 2.8.1] To reset all axes to the default values, call the */ |
356 * |
347 /* function with `num_coords' set to zero and `coords' set to NULL. */ |
357 * @note: |
348 /* */ |
358 * [Since 2.8.1] To reset all axes to the default values, call the |
349 /* [Since 2.9] If `num_coords' is larger than zero, this function */ |
359 * function with `num_coords` set to zero and `coords` set to `NULL`. |
350 /* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */ |
360 * |
351 /* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */ |
361 * [Since 2.9] If `num_coords` is larger than zero, this function sets |
352 /* is zero, this bit flag gets unset. */ |
362 * the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field |
353 /* */ |
363 * (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero, |
|
364 * this bit flag gets unset. |
|
365 */ |
354 FT_EXPORT( FT_Error ) |
366 FT_EXPORT( FT_Error ) |
355 FT_Set_MM_Design_Coordinates( FT_Face face, |
367 FT_Set_MM_Design_Coordinates( FT_Face face, |
356 FT_UInt num_coords, |
368 FT_UInt num_coords, |
357 FT_Long* coords ); |
369 FT_Long* coords ); |
358 |
370 |
359 |
371 |
360 /*************************************************************************/ |
372 /************************************************************************** |
361 /* */ |
373 * |
362 /* <Function> */ |
374 * @function: |
363 /* FT_Set_Var_Design_Coordinates */ |
375 * FT_Set_Var_Design_Coordinates |
364 /* */ |
376 * |
365 /* <Description> */ |
377 * @description: |
366 /* Choose an interpolated font design through design coordinates. */ |
378 * Choose an interpolated font design through design coordinates. |
367 /* */ |
379 * |
368 /* This function works with all supported variation formats. */ |
380 * This function works with all supported variation formats. |
369 /* */ |
381 * |
370 /* <InOut> */ |
382 * @inout: |
371 /* face :: A handle to the source face. */ |
383 * face :: |
372 /* */ |
384 * A handle to the source face. |
373 /* <Input> */ |
385 * |
374 /* num_coords :: The number of available design coordinates. If it */ |
386 * @input: |
375 /* is larger than the number of axes, ignore the excess */ |
387 * num_coords :: |
376 /* values. If it is smaller than the number of axes, */ |
388 * The number of available design coordinates. If it is larger than |
377 /* use default values for the remaining axes. */ |
389 * the number of axes, ignore the excess values. If it is smaller than |
378 /* */ |
390 * the number of axes, use default values for the remaining axes. |
379 /* coords :: An array of design coordinates. */ |
391 * |
380 /* */ |
392 * coords :: |
381 /* <Return> */ |
393 * An array of design coordinates. |
382 /* FreeType error code. 0~means success. */ |
394 * |
383 /* */ |
395 * @return: |
384 /* <Note> */ |
396 * FreeType error code. 0~means success. |
385 /* [Since 2.8.1] To reset all axes to the default values, call the */ |
397 * |
386 /* function with `num_coords' set to zero and `coords' set to NULL. */ |
398 * @note: |
387 /* [Since 2.9] `Default values' means the currently selected named */ |
399 * [Since 2.8.1] To reset all axes to the default values, call the |
388 /* instance (or the base font if no named instance is selected). */ |
400 * function with `num_coords` set to zero and `coords` set to `NULL`. |
389 /* */ |
401 * [Since 2.9] 'Default values' means the currently selected named |
390 /* [Since 2.9] If `num_coords' is larger than zero, this function */ |
402 * instance (or the base font if no named instance is selected). |
391 /* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */ |
403 * |
392 /* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */ |
404 * [Since 2.9] If `num_coords` is larger than zero, this function sets |
393 /* is zero, this bit flag gets unset. */ |
405 * the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field |
394 /* */ |
406 * (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero, |
|
407 * this bit flag gets unset. |
|
408 */ |
395 FT_EXPORT( FT_Error ) |
409 FT_EXPORT( FT_Error ) |
396 FT_Set_Var_Design_Coordinates( FT_Face face, |
410 FT_Set_Var_Design_Coordinates( FT_Face face, |
397 FT_UInt num_coords, |
411 FT_UInt num_coords, |
398 FT_Fixed* coords ); |
412 FT_Fixed* coords ); |
399 |
413 |
400 |
414 |
401 /*************************************************************************/ |
415 /************************************************************************** |
402 /* */ |
416 * |
403 /* <Function> */ |
417 * @function: |
404 /* FT_Get_Var_Design_Coordinates */ |
418 * FT_Get_Var_Design_Coordinates |
405 /* */ |
419 * |
406 /* <Description> */ |
420 * @description: |
407 /* Get the design coordinates of the currently selected interpolated */ |
421 * Get the design coordinates of the currently selected interpolated |
408 /* font. */ |
422 * font. |
409 /* */ |
423 * |
410 /* This function works with all supported variation formats. */ |
424 * This function works with all supported variation formats. |
411 /* */ |
425 * |
412 /* <Input> */ |
426 * @input: |
413 /* face :: A handle to the source face. */ |
427 * face :: |
414 /* */ |
428 * A handle to the source face. |
415 /* num_coords :: The number of design coordinates to retrieve. If it */ |
429 * |
416 /* is larger than the number of axes, set the excess */ |
430 * num_coords :: |
417 /* values to~0. */ |
431 * The number of design coordinates to retrieve. If it is larger than |
418 /* */ |
432 * the number of axes, set the excess values to~0. |
419 /* <Output> */ |
433 * |
420 /* coords :: The design coordinates array. */ |
434 * @output: |
421 /* */ |
435 * coords :: |
422 /* <Return> */ |
436 * The design coordinates array. |
423 /* FreeType error code. 0~means success. */ |
437 * |
424 /* */ |
438 * @return: |
425 /* <Since> */ |
439 * FreeType error code. 0~means success. |
426 /* 2.7.1 */ |
440 * |
427 /* */ |
441 * @since: |
|
442 * 2.7.1 |
|
443 */ |
428 FT_EXPORT( FT_Error ) |
444 FT_EXPORT( FT_Error ) |
429 FT_Get_Var_Design_Coordinates( FT_Face face, |
445 FT_Get_Var_Design_Coordinates( FT_Face face, |
430 FT_UInt num_coords, |
446 FT_UInt num_coords, |
431 FT_Fixed* coords ); |
447 FT_Fixed* coords ); |
432 |
448 |
433 |
449 |
434 /*************************************************************************/ |
450 /************************************************************************** |
435 /* */ |
451 * |
436 /* <Function> */ |
452 * @function: |
437 /* FT_Set_MM_Blend_Coordinates */ |
453 * FT_Set_MM_Blend_Coordinates |
438 /* */ |
454 * |
439 /* <Description> */ |
455 * @description: |
440 /* Choose an interpolated font design through normalized blend */ |
456 * Choose an interpolated font design through normalized blend |
441 /* coordinates. */ |
457 * coordinates. |
442 /* */ |
458 * |
443 /* This function works with all supported variation formats. */ |
459 * This function works with all supported variation formats. |
444 /* */ |
460 * |
445 /* <InOut> */ |
461 * @inout: |
446 /* face :: A handle to the source face. */ |
462 * face :: |
447 /* */ |
463 * A handle to the source face. |
448 /* <Input> */ |
464 * |
449 /* num_coords :: The number of available design coordinates. If it */ |
465 * @input: |
450 /* is larger than the number of axes, ignore the excess */ |
466 * num_coords :: |
451 /* values. If it is smaller than the number of axes, */ |
467 * The number of available design coordinates. If it is larger than |
452 /* use default values for the remaining axes. */ |
468 * the number of axes, ignore the excess values. If it is smaller than |
453 /* */ |
469 * the number of axes, use default values for the remaining axes. |
454 /* coords :: The design coordinates array (each element must be */ |
470 * |
455 /* between 0 and 1.0 for Adobe MM fonts, and between */ |
471 * coords :: |
456 /* -1.0 and 1.0 for TrueType GX and OpenType variation */ |
472 * The design coordinates array (each element must be between 0 and 1.0 |
457 /* fonts). */ |
473 * for Adobe MM fonts, and between -1.0 and 1.0 for TrueType GX and |
458 /* */ |
474 * OpenType variation fonts). |
459 /* <Return> */ |
475 * |
460 /* FreeType error code. 0~means success. */ |
476 * @return: |
461 /* */ |
477 * FreeType error code. 0~means success. |
462 /* <Note> */ |
478 * |
463 /* [Since 2.8.1] To reset all axes to the default values, call the */ |
479 * @note: |
464 /* function with `num_coords' set to zero and `coords' set to NULL. */ |
480 * [Since 2.8.1] To reset all axes to the default values, call the |
465 /* [Since 2.9] `Default values' means the currently selected named */ |
481 * function with `num_coords` set to zero and `coords` set to `NULL`. |
466 /* instance (or the base font if no named instance is selected). */ |
482 * [Since 2.9] 'Default values' means the currently selected named |
467 /* */ |
483 * instance (or the base font if no named instance is selected). |
468 /* [Since 2.9] If `num_coords' is larger than zero, this function */ |
484 * |
469 /* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */ |
485 * [Since 2.9] If `num_coords` is larger than zero, this function sets |
470 /* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */ |
486 * the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field |
471 /* is zero, this bit flag gets unset. */ |
487 * (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero, |
472 /* */ |
488 * this bit flag gets unset. |
|
489 */ |
473 FT_EXPORT( FT_Error ) |
490 FT_EXPORT( FT_Error ) |
474 FT_Set_MM_Blend_Coordinates( FT_Face face, |
491 FT_Set_MM_Blend_Coordinates( FT_Face face, |
475 FT_UInt num_coords, |
492 FT_UInt num_coords, |
476 FT_Fixed* coords ); |
493 FT_Fixed* coords ); |
477 |
494 |
478 |
495 |
479 /*************************************************************************/ |
496 /************************************************************************** |
480 /* */ |
497 * |
481 /* <Function> */ |
498 * @function: |
482 /* FT_Get_MM_Blend_Coordinates */ |
499 * FT_Get_MM_Blend_Coordinates |
483 /* */ |
500 * |
484 /* <Description> */ |
501 * @description: |
485 /* Get the normalized blend coordinates of the currently selected */ |
502 * Get the normalized blend coordinates of the currently selected |
486 /* interpolated font. */ |
503 * interpolated font. |
487 /* */ |
504 * |
488 /* This function works with all supported variation formats. */ |
505 * This function works with all supported variation formats. |
489 /* */ |
506 * |
490 /* <Input> */ |
507 * @input: |
491 /* face :: A handle to the source face. */ |
508 * face :: |
492 /* */ |
509 * A handle to the source face. |
493 /* num_coords :: The number of normalized blend coordinates to */ |
510 * |
494 /* retrieve. If it is larger than the number of axes, */ |
511 * num_coords :: |
495 /* set the excess values to~0.5 for Adobe MM fonts, and */ |
512 * The number of normalized blend coordinates to retrieve. If it is |
496 /* to~0 for TrueType GX and OpenType variation fonts. */ |
513 * larger than the number of axes, set the excess values to~0.5 for |
497 /* */ |
514 * Adobe MM fonts, and to~0 for TrueType GX and OpenType variation |
498 /* <Output> */ |
515 * fonts. |
499 /* coords :: The normalized blend coordinates array. */ |
516 * |
500 /* */ |
517 * @output: |
501 /* <Return> */ |
518 * coords :: |
502 /* FreeType error code. 0~means success. */ |
519 * The normalized blend coordinates array. |
503 /* */ |
520 * |
504 /* <Since> */ |
521 * @return: |
505 /* 2.7.1 */ |
522 * FreeType error code. 0~means success. |
506 /* */ |
523 * |
|
524 * @since: |
|
525 * 2.7.1 |
|
526 */ |
507 FT_EXPORT( FT_Error ) |
527 FT_EXPORT( FT_Error ) |
508 FT_Get_MM_Blend_Coordinates( FT_Face face, |
528 FT_Get_MM_Blend_Coordinates( FT_Face face, |
509 FT_UInt num_coords, |
529 FT_UInt num_coords, |
510 FT_Fixed* coords ); |
530 FT_Fixed* coords ); |
511 |
531 |
512 |
532 |
513 /*************************************************************************/ |
533 /************************************************************************** |
514 /* */ |
534 * |
515 /* <Function> */ |
535 * @function: |
516 /* FT_Set_Var_Blend_Coordinates */ |
536 * FT_Set_Var_Blend_Coordinates |
517 /* */ |
537 * |
518 /* <Description> */ |
538 * @description: |
519 /* This is another name of @FT_Set_MM_Blend_Coordinates. */ |
539 * This is another name of @FT_Set_MM_Blend_Coordinates. |
520 /* */ |
540 */ |
521 FT_EXPORT( FT_Error ) |
541 FT_EXPORT( FT_Error ) |
522 FT_Set_Var_Blend_Coordinates( FT_Face face, |
542 FT_Set_Var_Blend_Coordinates( FT_Face face, |
523 FT_UInt num_coords, |
543 FT_UInt num_coords, |
524 FT_Fixed* coords ); |
544 FT_Fixed* coords ); |
525 |
545 |
526 |
546 |
527 /*************************************************************************/ |
547 /************************************************************************** |
528 /* */ |
548 * |
529 /* <Function> */ |
549 * @function: |
530 /* FT_Get_Var_Blend_Coordinates */ |
550 * FT_Get_Var_Blend_Coordinates |
531 /* */ |
551 * |
532 /* <Description> */ |
552 * @description: |
533 /* This is another name of @FT_Get_MM_Blend_Coordinates. */ |
553 * This is another name of @FT_Get_MM_Blend_Coordinates. |
534 /* */ |
554 * |
535 /* <Since> */ |
555 * @since: |
536 /* 2.7.1 */ |
556 * 2.7.1 |
537 /* */ |
557 */ |
538 FT_EXPORT( FT_Error ) |
558 FT_EXPORT( FT_Error ) |
539 FT_Get_Var_Blend_Coordinates( FT_Face face, |
559 FT_Get_Var_Blend_Coordinates( FT_Face face, |
540 FT_UInt num_coords, |
560 FT_UInt num_coords, |
541 FT_Fixed* coords ); |
561 FT_Fixed* coords ); |
542 |
562 |
543 |
563 |
544 /*************************************************************************/ |
564 /************************************************************************** |
545 /* */ |
565 * |
546 /* <Enum> */ |
566 * @function: |
547 /* FT_VAR_AXIS_FLAG_XXX */ |
567 * FT_Set_MM_WeightVector |
548 /* */ |
568 * |
549 /* <Description> */ |
569 * @description: |
550 /* A list of bit flags used in the return value of */ |
570 * For Adobe MM fonts, choose an interpolated font design by directly |
551 /* @FT_Get_Var_Axis_Flags. */ |
571 * setting the weight vector. |
552 /* */ |
572 * |
553 /* <Values> */ |
573 * This function can't be used with TrueType GX or OpenType variation |
554 /* FT_VAR_AXIS_FLAG_HIDDEN :: */ |
574 * fonts. |
555 /* The variation axis should not be exposed to user interfaces. */ |
575 * |
556 /* */ |
576 * @inout: |
557 /* <Since> */ |
577 * face :: |
558 /* 2.8.1 */ |
578 * A handle to the source face. |
559 /* */ |
579 * |
|
580 * @input: |
|
581 * len :: |
|
582 * The length of the weight vector array. If it is larger than the |
|
583 * number of designs, the extra values are ignored. If it is less than |
|
584 * the number of designs, the remaining values are set to zero. |
|
585 * |
|
586 * weightvector :: |
|
587 * An array representing the weight vector. |
|
588 * |
|
589 * @return: |
|
590 * FreeType error code. 0~means success. |
|
591 * |
|
592 * @note: |
|
593 * Adobe Multiple Master fonts limit the number of designs, and thus the |
|
594 * length of the weight vector to~16. |
|
595 * |
|
596 * If `len` is zero and `weightvector` is `NULL`, the weight vector array |
|
597 * is reset to the default values. |
|
598 * |
|
599 * The Adobe documentation also states that the values in the |
|
600 * WeightVector array must total 1.0 +/-~0.001. In practice this does |
|
601 * not seem to be enforced, so is not enforced here, either. |
|
602 * |
|
603 * @since: |
|
604 * 2.10 |
|
605 */ |
|
606 FT_EXPORT( FT_Error ) |
|
607 FT_Set_MM_WeightVector( FT_Face face, |
|
608 FT_UInt len, |
|
609 FT_Fixed* weightvector ); |
|
610 |
|
611 |
|
612 /************************************************************************** |
|
613 * |
|
614 * @function: |
|
615 * FT_Get_MM_WeightVector |
|
616 * |
|
617 * @description: |
|
618 * For Adobe MM fonts, retrieve the current weight vector of the font. |
|
619 * |
|
620 * This function can't be used with TrueType GX or OpenType variation |
|
621 * fonts. |
|
622 * |
|
623 * @inout: |
|
624 * face :: |
|
625 * A handle to the source face. |
|
626 * |
|
627 * len :: |
|
628 * A pointer to the size of the array to be filled. If the size of the |
|
629 * array is less than the number of designs, `FT_Err_Invalid_Argument` |
|
630 * is returned, and `len` is set to the required size (the number of |
|
631 * designs). If the size of the array is greater than the number of |
|
632 * designs, the remaining entries are set to~0. On successful |
|
633 * completion, `len` is set to the number of designs (i.e., the number |
|
634 * of values written to the array). |
|
635 * |
|
636 * @output: |
|
637 * weightvector :: |
|
638 * An array to be filled. |
|
639 * |
|
640 * @return: |
|
641 * FreeType error code. 0~means success. |
|
642 * |
|
643 * @note: |
|
644 * Adobe Multiple Master fonts limit the number of designs, and thus the |
|
645 * length of the WeightVector to~16. |
|
646 * |
|
647 * @since: |
|
648 * 2.10 |
|
649 */ |
|
650 FT_EXPORT( FT_Error ) |
|
651 FT_Get_MM_WeightVector( FT_Face face, |
|
652 FT_UInt* len, |
|
653 FT_Fixed* weightvector ); |
|
654 |
|
655 |
|
656 /************************************************************************** |
|
657 * |
|
658 * @enum: |
|
659 * FT_VAR_AXIS_FLAG_XXX |
|
660 * |
|
661 * @description: |
|
662 * A list of bit flags used in the return value of |
|
663 * @FT_Get_Var_Axis_Flags. |
|
664 * |
|
665 * @values: |
|
666 * FT_VAR_AXIS_FLAG_HIDDEN :: |
|
667 * The variation axis should not be exposed to user interfaces. |
|
668 * |
|
669 * @since: |
|
670 * 2.8.1 |
|
671 */ |
560 #define FT_VAR_AXIS_FLAG_HIDDEN 1 |
672 #define FT_VAR_AXIS_FLAG_HIDDEN 1 |
561 |
673 |
562 |
674 |
563 /*************************************************************************/ |
675 /************************************************************************** |
564 /* */ |
676 * |
565 /* <Function> */ |
677 * @function: |
566 /* FT_Get_Var_Axis_Flags */ |
678 * FT_Get_Var_Axis_Flags |
567 /* */ |
679 * |
568 /* <Description> */ |
680 * @description: |
569 /* Get the `flags' field of an OpenType Variation Axis Record. */ |
681 * Get the 'flags' field of an OpenType Variation Axis Record. |
570 /* */ |
682 * |
571 /* Not meaningful for Adobe MM fonts (`*flags' is always zero). */ |
683 * Not meaningful for Adobe MM fonts (`*flags` is always zero). |
572 /* */ |
684 * |
573 /* <Input> */ |
685 * @input: |
574 /* master :: The variation descriptor. */ |
686 * master :: |
575 /* */ |
687 * The variation descriptor. |
576 /* axis_index :: The index of the requested variation axis. */ |
688 * |
577 /* */ |
689 * axis_index :: |
578 /* <Output> */ |
690 * The index of the requested variation axis. |
579 /* flags :: The `flags' field. See @FT_VAR_AXIS_FLAG_XXX for */ |
691 * |
580 /* possible values. */ |
692 * @output: |
581 /* */ |
693 * flags :: |
582 /* <Return> */ |
694 * The 'flags' field. See @FT_VAR_AXIS_FLAG_XXX for possible values. |
583 /* FreeType error code. 0~means success. */ |
695 * |
584 /* */ |
696 * @return: |
585 /* <Since> */ |
697 * FreeType error code. 0~means success. |
586 /* 2.8.1 */ |
698 * |
587 /* */ |
699 * @since: |
|
700 * 2.8.1 |
|
701 */ |
588 FT_EXPORT( FT_Error ) |
702 FT_EXPORT( FT_Error ) |
589 FT_Get_Var_Axis_Flags( FT_MM_Var* master, |
703 FT_Get_Var_Axis_Flags( FT_MM_Var* master, |
590 FT_UInt axis_index, |
704 FT_UInt axis_index, |
591 FT_UInt* flags ); |
705 FT_UInt* flags ); |
592 |
706 |
593 |
707 |
594 /*************************************************************************/ |
708 /************************************************************************** |
595 /* */ |
709 * |
596 /* <Function> */ |
710 * @function: |
597 /* FT_Set_Named_Instance */ |
711 * FT_Set_Named_Instance |
598 /* */ |
712 * |
599 /* <Description> */ |
713 * @description: |
600 /* Set or change the current named instance. */ |
714 * Set or change the current named instance. |
601 /* */ |
715 * |
602 /* <Input> */ |
716 * @input: |
603 /* face :: A handle to the source face. */ |
717 * face :: |
604 /* */ |
718 * A handle to the source face. |
605 /* instance_index :: The index of the requested instance, starting */ |
719 * |
606 /* with value 1. If set to value 0, FreeType */ |
720 * instance_index :: |
607 /* switches to font access without a named */ |
721 * The index of the requested instance, starting with value 1. If set |
608 /* instance. */ |
722 * to value 0, FreeType switches to font access without a named |
609 /* */ |
723 * instance. |
610 /* <Return> */ |
724 * |
611 /* FreeType error code. 0~means success. */ |
725 * @return: |
612 /* */ |
726 * FreeType error code. 0~means success. |
613 /* <Note> */ |
727 * |
614 /* The function uses the value of `instance_index' to set bits 16-30 */ |
728 * @note: |
615 /* of the face's `face_index' field. It also resets any variation */ |
729 * The function uses the value of `instance_index` to set bits 16-30 of |
616 /* applied to the font, and the @FT_FACE_FLAG_VARIATION bit of the */ |
730 * the face's `face_index` field. It also resets any variation applied |
617 /* face's `face_flags' field gets reset to zero (i.e., */ |
731 * to the font, and the @FT_FACE_FLAG_VARIATION bit of the face's |
618 /* @FT_IS_VARIATION will return false). */ |
732 * `face_flags` field gets reset to zero (i.e., @FT_IS_VARIATION will |
619 /* */ |
733 * return false). |
620 /* For Adobe MM fonts (which don't have named instances) this */ |
734 * |
621 /* function simply resets the current face to the default instance. */ |
735 * For Adobe MM fonts (which don't have named instances) this function |
622 /* */ |
736 * simply resets the current face to the default instance. |
623 /* <Since> */ |
737 * |
624 /* 2.9 */ |
738 * @since: |
625 /* */ |
739 * 2.9 |
|
740 */ |
626 FT_EXPORT( FT_Error ) |
741 FT_EXPORT( FT_Error ) |
627 FT_Set_Named_Instance( FT_Face face, |
742 FT_Set_Named_Instance( FT_Face face, |
628 FT_UInt instance_index ); |
743 FT_UInt instance_index ); |
629 |
744 |
630 /* */ |
745 /* */ |