sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
ftmm.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * ftmm.h
4 *
5 * FreeType variation font interface (specification).
6 *
7 * Copyright (C) 1996-2025 by
8 * David Turner, Robert Wilhelm, and Werner Lemberg.
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
23#ifndef FTMM_H_
24#define FTMM_H_
25
26#include <freetype/freetype.h>
27
28#ifdef FREETYPE_H
29#error "freetype.h of FreeType 1 has been loaded!"
30#error "Please fix the directory search order for header files"
31#error "so that freetype.h of FreeType 2 is found first."
32#endif
33
34
35FT_BEGIN_HEADER
36
37
38 /**************************************************************************
39 *
40 * @section:
41 * multiple_masters
42 *
43 * @title:
44 * OpenType Font Variations, TrueType GX, and Adobe MM Fonts
45 *
46 * @abstract:
47 * How to manage variable fonts with multiple design axes.
48 *
49 * @description:
50 * The following types and functions manage OpenType Font Variations,
51 * Adobe Multiple Master (MM) fonts, and Apple TrueType GX fonts. These
52 * formats have in common that they allow the selection of specific
53 * design instances by setting design coordinates for one or more axes
54 * like font weight or width.
55 *
56 * For historical reasons there are two interfaces. The first, older one
57 * can be used with Adobe MM fonts only, and the second, newer one is a
58 * unified interface that handles all three font formats. However, some
59 * differences remain and are documented accordingly; in particular,
60 * Adobe MM fonts don't have named instances (see below).
61 *
62 * For Adobe MM fonts, macro @FT_IS_SFNT returns false. For TrueType GX
63 * and OpenType Font Variations, it returns true.
64 *
65 * We use mostly the terminology of the OpenType standard. Here are some
66 * important technical terms.
67 *
68 * * A 'named instance' is a tuple of design coordinates that has a
69 * string ID (i.e., an index into the font's 'name' table) associated
70 * with it. The font can tell the user that, for example,
71 * [Weight=700,Width=110] is 'Bold'. Another name for 'named instance'
72 * is 'named style'.
73 *
74 * Adobe MM fonts don't have named instances.
75 *
76 * * The 'default instance' of a variation font is that instance for
77 * which the nth axis coordinate is equal to the nth default axis
78 * coordinate (i.e., `axis[n].def` as specified in the @FT_MM_Var
79 * structure), with~n covering all axes. In TrueType GX and OpenType
80 * Font Variations, the default instance is explicitly given. In Adobe
81 * MM fonts, the `WeightVector` entry as found in the font file is
82 * taken as the default instance.
83 *
84 * For TrueType GX and OpenType Font Variations, FreeType synthesizes
85 * a named instance for the default instance if the font does not
86 * contain such an entry.
87 *
88 * * 'Design coordinates' are the axis values found in a variation font
89 * file. Their meaning is specified by the font designer and the
90 * values are rather arbitrary.
91 *
92 * For example, the 'weight' axis in design coordinates might vary
93 * between 100 (thin) and 900 (heavy) in font~A, while font~B
94 * contains values between 400 (normal) and 800 (extra bold).
95 *
96 * * 'Normalized coordinates' are design coordinates mapped to a standard
97 * range; they are also called 'blend coordinates'.
98 *
99 * For TrueType GX and OpenType Font Variations, the range is [-1;1],
100 * with the minimum mapped to value~-1, the default mapped to
101 * value~0, and the maximum mapped to value~1, and all other
102 * coordinates mapped to intervening points. Please look up the
103 * [OpenType
104 * specification](https://learn.microsoft.com/en-us/typography/opentype/spec/otvaroverview)
105 * on how this mapping works in detail.
106 *
107 * For Adobe MM fonts, this standard range is [0;1], with the minimum
108 * mapped to value~0 and the maximum mapped to value~1, and all other
109 * coordinates mapped to intervening points. Please look up [Adobe
110 * TechNote
111 * #5015](https://adobe-type-tools.github.io/font-tech-notes/pdfs/5015.Type1_Supp.pdf)
112 * on how this mapping works in detail.
113 *
114 * Assuming that the two fonts in the previous example are OpenType
115 * Font Variations, both font~A's [100;900] and font~B's [400;800]
116 * coordinate ranges get mapped to [-1;1].
117 */
118
119
120 /**************************************************************************
121 *
122 * @enum:
123 * T1_MAX_MM_XXX
124 *
125 * @description:
126 * Adobe MM font limits as defined in their specifications.
127 *
128 * @values:
129 * T1_MAX_MM_AXIS ::
130 * The maximum number of Adobe MM font axes.
131 *
132 * T1_MAX_MM_DESIGNS ::
133 * The maximum number of Adobe MM font designs.
134 *
135 * T1_MAX_MM_MAP_POINTS ::
136 * The maximum number of elements in a design map.
137 *
138 */
139#define T1_MAX_MM_AXIS 4
140#define T1_MAX_MM_DESIGNS 16
141#define T1_MAX_MM_MAP_POINTS 20
142
143
144 /**************************************************************************
145 *
146 * @struct:
147 * FT_MM_Axis
148 *
149 * @description:
150 * A structure to model a given axis in design space for Adobe MM fonts.
151 *
152 * This structure can't be used with TrueType GX or OpenType Font
153 * Variations.
154 *
155 * @fields:
156 * name ::
157 * The axis's name.
158 *
159 * minimum ::
160 * The axis's minimum design coordinate.
161 *
162 * maximum ::
163 * The axis's maximum design coordinate.
164 */
165 typedef struct FT_MM_Axis_
166 {
167 FT_String* name;
168 FT_Long minimum;
169 FT_Long maximum;
170
171 } FT_MM_Axis;
172
173
174 /**************************************************************************
175 *
176 * @struct:
177 * FT_Multi_Master
178 *
179 * @description:
180 * A structure to model the axes and space of an Adobe MM font.
181 *
182 * This structure can't be used with TrueType GX or OpenType Font
183 * Variations.
184 *
185 * @fields:
186 * num_axis ::
187 * Number of axes. Cannot exceed~4.
188 *
189 * num_designs ::
190 * Number of designs; should be normally `2^num_axis` even though the
191 * Type~1 specification strangely allows for intermediate designs to be
192 * present. This number cannot exceed~16.
193 *
194 * axis ::
195 * A table of axis descriptors.
196 */
197 typedef struct FT_Multi_Master_
198 {
199 FT_UInt num_axis;
200 FT_UInt num_designs;
201 FT_MM_Axis axis[T1_MAX_MM_AXIS];
202
203 } FT_Multi_Master;
204
205
206 /**************************************************************************
207 *
208 * @struct:
209 * FT_Var_Axis
210 *
211 * @description:
212 * A structure to model a given axis in design space for Adobe MM fonts,
213 * TrueType GX, and OpenType Font Variations.
214 *
215 * @fields:
216 * name ::
217 * The axis's name. Not always meaningful for TrueType GX or OpenType
218 * Font Variations.
219 *
220 * minimum ::
221 * The axis's minimum design coordinate.
222 *
223 * def ::
224 * The axis's default design coordinate. FreeType computes meaningful
225 * default values for Adobe MM fonts.
226 *
227 * maximum ::
228 * The axis's maximum design coordinate.
229 *
230 * tag ::
231 * The axis's tag (the equivalent to 'name' for TrueType GX and
232 * OpenType Font Variations). FreeType provides default values for
233 * Adobe MM fonts if possible.
234 *
235 * strid ::
236 * The axis name entry in the font's 'name' table. This is another
237 * (and often better) version of the 'name' field for TrueType GX or
238 * OpenType Font Variations. Not meaningful for Adobe MM fonts.
239 *
240 * @note:
241 * The fields `minimum`, `def`, and `maximum` are 16.16 fractional values
242 * for TrueType GX and OpenType Font Variations. For Adobe MM fonts, the
243 * values are whole numbers (i.e., the fractional part is zero).
244 */
245 typedef struct FT_Var_Axis_
246 {
247 FT_String* name;
248
249 FT_Fixed minimum;
250 FT_Fixed def;
251 FT_Fixed maximum;
252
253 FT_ULong tag;
254 FT_UInt strid;
255
256 } FT_Var_Axis;
257
258
259 /**************************************************************************
260 *
261 * @struct:
262 * FT_Var_Named_Style
263 *
264 * @description:
265 * A structure to model a named instance in a TrueType GX or OpenType
266 * Font Variations.
267 *
268 * This structure can't be used for Adobe MM fonts.
269 *
270 * @fields:
271 * coords ::
272 * The design coordinates for this instance. This is an array with one
273 * entry for each axis.
274 *
275 * strid ::
276 * An index into the 'name' table identifying this instance.
277 *
278 * psid ::
279 * An index into the 'name' table identifying a PostScript name for
280 * this instance. Value 0xFFFF indicates a missing entry.
281 */
282 typedef struct FT_Var_Named_Style_
283 {
284 FT_Fixed* coords;
285 FT_UInt strid;
286 FT_UInt psid; /* since 2.7.1 */
287
288 } FT_Var_Named_Style;
289
290
291 /**************************************************************************
292 *
293 * @struct:
294 * FT_MM_Var
295 *
296 * @description:
297 * A structure to model the axes and space of Adobe MM fonts, TrueType
298 * GX, or OpenType Font Variations.
299 *
300 * Some fields are specific to one format and not to the others.
301 *
302 * @fields:
303 * num_axis ::
304 * The number of axes. The maximum value is~4 for Adobe MM fonts; no
305 * limit in TrueType GX or OpenType Font Variations.
306 *
307 * num_designs ::
308 * The number of designs; should be normally `2^num_axis` for Adobe MM
309 * fonts. Not meaningful for TrueType GX or OpenType Font Variations
310 * (where every glyph could have a different number of designs).
311 *
312 * num_namedstyles ::
313 * The number of named instances. For Adobe MM fonts, this value is
314 * always zero.
315 *
316 * axis ::
317 * An axis descriptor table. TrueType GX and OpenType Font Variations
318 * contain slightly more data than Adobe MM fonts. Memory management
319 * of this pointer is done internally by FreeType.
320 *
321 * namedstyle ::
322 * An array of named instances. Only meaningful for TrueType GX and
323 * OpenType Font Variations. Memory management of this pointer is done
324 * internally by FreeType.
325 */
326 typedef struct FT_MM_Var_
327 {
328 FT_UInt num_axis;
329 FT_UInt num_designs;
330 FT_UInt num_namedstyles;
331 FT_Var_Axis* axis;
332 FT_Var_Named_Style* namedstyle;
333
334 } FT_MM_Var;
335
336
337 /**************************************************************************
338 *
339 * @function:
340 * FT_Get_Multi_Master
341 *
342 * @description:
343 * Retrieve a variation descriptor of a given Adobe MM font.
344 *
345 * This function can't be used with TrueType GX or OpenType Font
346 * Variations.
347 *
348 * @input:
349 * face ::
350 * A handle to the source face.
351 *
352 * @output:
353 * amaster ::
354 * The Adobe MM font's variation descriptor.
355 *
356 * @return:
357 * FreeType error code. 0~means success.
358 */
359 FT_EXPORT( FT_Error )
360 FT_Get_Multi_Master( FT_Face face,
361 FT_Multi_Master *amaster );
362
363
364 /**************************************************************************
365 *
366 * @function:
367 * FT_Get_MM_Var
368 *
369 * @description:
370 * Retrieve a variation descriptor for a given font.
371 *
372 * This function works with all supported variation formats.
373 *
374 * @input:
375 * face ::
376 * A handle to the source face.
377 *
378 * @output:
379 * amaster ::
380 * The variation descriptor. Allocates a data structure, which the
381 * user must deallocate with a call to @FT_Done_MM_Var after use.
382 *
383 * @return:
384 * FreeType error code. 0~means success.
385 */
386 FT_EXPORT( FT_Error )
387 FT_Get_MM_Var( FT_Face face,
388 FT_MM_Var* *amaster );
389
390
391 /**************************************************************************
392 *
393 * @function:
394 * FT_Done_MM_Var
395 *
396 * @description:
397 * Free the memory allocated by @FT_Get_MM_Var.
398 *
399 * @input:
400 * library ::
401 * A handle of the face's parent library object that was used in the
402 * call to @FT_Get_MM_Var to create `amaster`.
403 *
404 * @return:
405 * FreeType error code. 0~means success.
406 */
407 FT_EXPORT( FT_Error )
408 FT_Done_MM_Var( FT_Library library,
409 FT_MM_Var *amaster );
410
411
412 /**************************************************************************
413 *
414 * @function:
415 * FT_Set_MM_Design_Coordinates
416 *
417 * @description:
418 * For Adobe MM fonts, choose an interpolated font design through design
419 * coordinates.
420 *
421 * This function can't be used with TrueType GX or OpenType Font
422 * Variations.
423 *
424 * @inout:
425 * face ::
426 * A handle to the source face.
427 *
428 * @input:
429 * num_coords ::
430 * The number of available design coordinates. If it is larger than
431 * the number of axes, ignore the excess values. If it is smaller than
432 * the number of axes, use default values for the remaining axes.
433 *
434 * coords ::
435 * An array of design coordinates.
436 *
437 * @return:
438 * FreeType error code. 0~means success.
439 *
440 * @note:
441 * [Since 2.8.1] To reset all axes to the default values, call the
442 * function with `num_coords` set to zero and `coords` set to `NULL`.
443 *
444 * [Since 2.9] If `num_coords` is larger than zero, this function sets
445 * the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
446 * (i.e., @FT_IS_VARIATION returns true). If `num_coords` is zero, this
447 * bit flag gets unset.
448 */
449 FT_EXPORT( FT_Error )
450 FT_Set_MM_Design_Coordinates( FT_Face face,
451 FT_UInt num_coords,
452 FT_Long* coords );
453
454
455 /**************************************************************************
456 *
457 * @function:
458 * FT_Set_Var_Design_Coordinates
459 *
460 * @description:
461 * Choose an interpolated font design through design coordinates.
462 *
463 * This function works with all supported variation formats.
464 *
465 * @inout:
466 * face ::
467 * A handle to the source face.
468 *
469 * @input:
470 * num_coords ::
471 * The number of available design coordinates. If it is larger than
472 * the number of axes, ignore the excess values. If it is smaller than
473 * the number of axes, use default values for the remaining axes.
474 *
475 * coords ::
476 * An array of design coordinates.
477 *
478 * @return:
479 * FreeType error code. 0~means success.
480 *
481 * @note:
482 * The design coordinates are 16.16 fractional values for TrueType GX and
483 * OpenType Font Variations. For Adobe MM fonts, the values are supposed
484 * to be whole numbers (i.e., the fractional part is zero).
485 *
486 * [Since 2.8.1] To reset all axes to the default values, call the
487 * function with `num_coords` set to zero and `coords` set to `NULL`.
488 * [Since 2.9] 'Default values' means the currently selected named
489 * instance (or the base font if no named instance is selected).
490 *
491 * [Since 2.9] If `num_coords` is larger than zero, this function sets
492 * the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
493 * (i.e., @FT_IS_VARIATION returns true). If `num_coords` is zero, this
494 * bit flag gets unset.
495 *
496 * [Since 2.14] This function also sets the @FT_FACE_FLAG_VARIATION bit
497 * in @FT_Face's `face_flags` field (i.e., @FT_IS_VARIATION returns
498 * true) if any of the provided coordinates is different from the face's
499 * default value for the corresponding axis, that is, the set up face is
500 * not at its default position.
501 */
502 FT_EXPORT( FT_Error )
503 FT_Set_Var_Design_Coordinates( FT_Face face,
504 FT_UInt num_coords,
505 FT_Fixed* coords );
506
507
508 /**************************************************************************
509 *
510 * @function:
511 * FT_Get_Var_Design_Coordinates
512 *
513 * @description:
514 * Get the design coordinates of the currently selected interpolated
515 * font.
516 *
517 * This function works with all supported variation formats.
518 *
519 * @input:
520 * face ::
521 * A handle to the source face.
522 *
523 * num_coords ::
524 * The number of design coordinates to retrieve. If it is larger than
525 * the number of axes, set the excess values to~0.
526 *
527 * @output:
528 * coords ::
529 * The design coordinates array, which must be allocated by the user.
530 *
531 * @return:
532 * FreeType error code. 0~means success.
533 *
534 * @note:
535 * The design coordinates are 16.16 fractional values for TrueType GX and
536 * OpenType Font Variations. For Adobe MM fonts, the values are whole
537 * numbers (i.e., the fractional part is zero).
538 *
539 * @since:
540 * 2.7.1
541 */
542 FT_EXPORT( FT_Error )
543 FT_Get_Var_Design_Coordinates( FT_Face face,
544 FT_UInt num_coords,
545 FT_Fixed* coords );
546
547
548 /**************************************************************************
549 *
550 * @function:
551 * FT_Set_MM_Blend_Coordinates
552 *
553 * @description:
554 * Choose an interpolated font design through normalized coordinates.
555 *
556 * This function works with all supported variation formats.
557 *
558 * @inout:
559 * face ::
560 * A handle to the source face.
561 *
562 * @input:
563 * num_coords ::
564 * The number of available design coordinates. If it is larger than
565 * the number of axes, ignore the excess values. If it is smaller than
566 * the number of axes, use default values for the remaining axes.
567 *
568 * coords ::
569 * The normalized coordinates array. Each element is a 16.16
570 * fractional value and must be between 0 and 1.0 for Adobe MM fonts,
571 * and between -1.0 and 1.0 for TrueType GX and OpenType Font
572 * Variations.
573 *
574 * @return:
575 * FreeType error code. 0~means success.
576 *
577 * @note:
578 * [Since 2.8.1] To reset all axes to the default values, call the
579 * function with `num_coords` set to zero and `coords` set to `NULL`.
580 * [Since 2.9] 'Default values' means the currently selected named
581 * instance (or the base font if no named instance is selected).
582 *
583 * [Since 2.9] If `num_coords` is larger than zero, this function sets
584 * the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
585 * (i.e., @FT_IS_VARIATION returns true). If `num_coords` is zero, this
586 * bit flag gets unset.
587 *
588 * [Since 2.14] This function also sets the @FT_FACE_FLAG_VARIATION bit
589 * in @FT_Face's `face_flags` field (i.e., @FT_IS_VARIATION returns
590 * true) if any of the provided coordinates is different from the face's
591 * default value for the corresponding axis, that is, the set up face is
592 * not at its default position.
593 */
594 FT_EXPORT( FT_Error )
595 FT_Set_MM_Blend_Coordinates( FT_Face face,
596 FT_UInt num_coords,
597 FT_Fixed* coords );
598
599
600 /**************************************************************************
601 *
602 * @function:
603 * FT_Get_MM_Blend_Coordinates
604 *
605 * @description:
606 * Get the normalized coordinates of the currently selected interpolated
607 * font.
608 *
609 * This function works with all supported variation formats.
610 *
611 * @input:
612 * face ::
613 * A handle to the source face.
614 *
615 * num_coords ::
616 * The number of normalized coordinates to retrieve. If it is larger
617 * than the number of axes, set the excess values to~0.5 for Adobe MM
618 * fonts, and to~0 for TrueType GX and OpenType Font Variations.
619 *
620 * @output:
621 * coords ::
622 * The normalized coordinates array (as 16.16 fractional values), which
623 * must be allocated by the user.
624 *
625 * @return:
626 * FreeType error code. 0~means success.
627 *
628 * @since:
629 * 2.7.1
630 */
631 FT_EXPORT( FT_Error )
632 FT_Get_MM_Blend_Coordinates( FT_Face face,
633 FT_UInt num_coords,
634 FT_Fixed* coords );
635
636
637 /**************************************************************************
638 *
639 * @function:
640 * FT_Set_Var_Blend_Coordinates
641 *
642 * @description:
643 * This is another name of @FT_Set_MM_Blend_Coordinates.
644 */
645 FT_EXPORT( FT_Error )
646 FT_Set_Var_Blend_Coordinates( FT_Face face,
647 FT_UInt num_coords,
648 FT_Fixed* coords );
649
650
651 /**************************************************************************
652 *
653 * @function:
654 * FT_Get_Var_Blend_Coordinates
655 *
656 * @description:
657 * This is another name of @FT_Get_MM_Blend_Coordinates.
658 *
659 * @since:
660 * 2.7.1
661 */
662 FT_EXPORT( FT_Error )
663 FT_Get_Var_Blend_Coordinates( FT_Face face,
664 FT_UInt num_coords,
665 FT_Fixed* coords );
666
667
668 /**************************************************************************
669 *
670 * @function:
671 * FT_Set_MM_WeightVector
672 *
673 * @description:
674 * For Adobe MM fonts, choose an interpolated font design by directly
675 * setting the weight vector.
676 *
677 * This function can't be used with TrueType GX or OpenType Font
678 * Variations.
679 *
680 * @inout:
681 * face ::
682 * A handle to the source face.
683 *
684 * @input:
685 * len ::
686 * The length of the weight vector array. If it is larger than the
687 * number of designs, the extra values are ignored. If it is less than
688 * the number of designs, the remaining values are set to zero.
689 *
690 * weightvector ::
691 * An array representing the weight vector.
692 *
693 * @return:
694 * FreeType error code. 0~means success.
695 *
696 * @note:
697 * Adobe MM fonts limit the number of designs, and thus the length of the
698 * weight vector, to 16~elements.
699 *
700 * If `len` is larger than zero, this function sets the
701 * @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field (i.e.,
702 * @FT_IS_VARIATION returns true). If `len` is zero, this bit flag is
703 * unset and the weight vector array is reset to the default values.
704 *
705 * The Adobe documentation also states that the values in the
706 * `WeightVector` array must total 1.0 +/-~0.001. In practice this does
707 * not seem to be enforced, so is not enforced here, either.
708 *
709 * @since:
710 * 2.10
711 */
712 FT_EXPORT( FT_Error )
713 FT_Set_MM_WeightVector( FT_Face face,
714 FT_UInt len,
715 FT_Fixed* weightvector );
716
717
718 /**************************************************************************
719 *
720 * @function:
721 * FT_Get_MM_WeightVector
722 *
723 * @description:
724 * For Adobe MM fonts, retrieve the current weight vector of the font.
725 *
726 * This function can't be used with TrueType GX or OpenType Font
727 * Variations.
728 *
729 * @inout:
730 * face ::
731 * A handle to the source face.
732 *
733 * len ::
734 * A pointer to the size of the array to be filled. If the size of the
735 * array is less than the number of designs, `FT_Err_Invalid_Argument`
736 * is returned, and `len` is set to the required size (the number of
737 * designs). If the size of the array is greater than the number of
738 * designs, the remaining entries are set to~0. On successful
739 * completion, `len` is set to the number of designs (i.e., the number
740 * of values written to the array).
741 *
742 * @output:
743 * weightvector ::
744 * An array to be filled; it must be allocated by the user.
745 *
746 * @return:
747 * FreeType error code. 0~means success.
748 *
749 * @note:
750 * Adobe MM fonts limit the number of designs, and thus the length of the
751 * weight vector, to~16 elements.
752 *
753 * @since:
754 * 2.10
755 */
756 FT_EXPORT( FT_Error )
757 FT_Get_MM_WeightVector( FT_Face face,
758 FT_UInt* len,
759 FT_Fixed* weightvector );
760
761
762 /**************************************************************************
763 *
764 * @enum:
765 * FT_VAR_AXIS_FLAG_XXX
766 *
767 * @description:
768 * A list of bit flags used in the return value of
769 * @FT_Get_Var_Axis_Flags.
770 *
771 * @values:
772 * FT_VAR_AXIS_FLAG_HIDDEN ::
773 * The variation axis should not be exposed to user interfaces.
774 *
775 * @since:
776 * 2.8.1
777 */
778#define FT_VAR_AXIS_FLAG_HIDDEN 1
779
780
781 /**************************************************************************
782 *
783 * @function:
784 * FT_Get_Var_Axis_Flags
785 *
786 * @description:
787 * Get the 'flags' field of an OpenType Variation Axis Record.
788 *
789 * Not meaningful for Adobe MM fonts (`*flags` is always zero).
790 *
791 * @input:
792 * master ::
793 * The variation descriptor.
794 *
795 * axis_index ::
796 * The index of the requested variation axis.
797 *
798 * @output:
799 * flags ::
800 * The 'flags' field. See @FT_VAR_AXIS_FLAG_XXX for possible values.
801 *
802 * @return:
803 * FreeType error code. 0~means success.
804 *
805 * @since:
806 * 2.8.1
807 */
808 FT_EXPORT( FT_Error )
809 FT_Get_Var_Axis_Flags( FT_MM_Var* master,
810 FT_UInt axis_index,
811 FT_UInt* flags );
812
813
814 /**************************************************************************
815 *
816 * @function:
817 * FT_Set_Named_Instance
818 *
819 * @description:
820 * Set or change the current named instance.
821 *
822 * @input:
823 * face ::
824 * A handle to the source face.
825 *
826 * instance_index ::
827 * The index of the requested instance, starting with value~1. If set
828 * to value~0, FreeType switches to font access without a named
829 * instance.
830 *
831 * @return:
832 * FreeType error code. 0~means success.
833 *
834 * @note:
835 * The function uses the value of `instance_index` to set bits 16-30 of
836 * the face's `face_index` field. It also resets any variation applied
837 * to the font, and the @FT_FACE_FLAG_VARIATION bit of the face's
838 * `face_flags` field gets reset to zero (i.e., @FT_IS_VARIATION returns
839 * false).
840 *
841 * For Adobe MM fonts, this function resets the current face to the
842 * default instance.
843 *
844 * @since:
845 * 2.9
846 */
847 FT_EXPORT( FT_Error )
848 FT_Set_Named_Instance( FT_Face face,
849 FT_UInt instance_index );
850
851
852 /**************************************************************************
853 *
854 * @function:
855 * FT_Get_Default_Named_Instance
856 *
857 * @description:
858 * Retrieve the index of the default named instance, to be used with
859 * @FT_Set_Named_Instance.
860 *
861 * FreeType synthesizes a named instance for the default instance if the
862 * font does not contain such an entry.
863 *
864 * @input:
865 * face ::
866 * A handle to the source face.
867 *
868 * @output:
869 * instance_index ::
870 * The index of the default named instance.
871 *
872 * @return:
873 * FreeType error code. 0~means success.
874 *
875 * @note:
876 * For Adobe MM fonts, this function always returns zero for
877 * `instance_index`.
878 *
879 * @since:
880 * 2.13.1
881 */
882 FT_EXPORT( FT_Error )
883 FT_Get_Default_Named_Instance( FT_Face face,
884 FT_UInt *instance_index );
885
886 /* */
887
888
889FT_END_HEADER
890
891#endif /* FTMM_H_ */
892
893
894/* END */