Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-07 08:22:51

0001 /****************************************************************************
0002  *
0003  * ftmm.h
0004  *
0005  *   FreeType variation font interface (specification).
0006  *
0007  * Copyright (C) 1996-2025 by
0008  * David Turner, Robert Wilhelm, and Werner Lemberg.
0009  *
0010  * This file is part of the FreeType project, and may only be used,
0011  * modified, and distributed under the terms of the FreeType project
0012  * license, LICENSE.TXT.  By continuing to use, modify, or distribute
0013  * this file you indicate that you have read the license and
0014  * understand and accept it fully.
0015  *
0016  */
0017 
0018 
0019 #ifndef FTMM_H_
0020 #define FTMM_H_
0021 
0022 #include <freetype/freetype.h>
0023 
0024 #ifdef FREETYPE_H
0025 #error "freetype.h of FreeType 1 has been loaded!"
0026 #error "Please fix the directory search order for header files"
0027 #error "so that freetype.h of FreeType 2 is found first."
0028 #endif
0029 
0030 
0031 FT_BEGIN_HEADER
0032 
0033 
0034   /**************************************************************************
0035    *
0036    * @section:
0037    *   multiple_masters
0038    *
0039    * @title:
0040    *   OpenType Font Variations, TrueType GX, and Adobe MM Fonts
0041    *
0042    * @abstract:
0043    *   How to manage variable fonts with multiple design axes.
0044    *
0045    * @description:
0046    *   The following types and functions manage OpenType Font Variations,
0047    *   Adobe Multiple Master (MM) fonts, and Apple TrueType GX fonts.  These
0048    *   formats have in common that they allow the selection of specific
0049    *   design instances by setting design coordinates for one or more axes
0050    *   like font weight or width.
0051    *
0052    *   For historical reasons there are two interfaces.  The first, older one
0053    *   can be used with Adobe MM fonts only, and the second, newer one is a
0054    *   unified interface that handles all three font formats.  However, some
0055    *   differences remain and are documented accordingly; in particular,
0056    *   Adobe MM fonts don't have named instances (see below).
0057    *
0058    *   For Adobe MM fonts, macro @FT_IS_SFNT returns false.  For TrueType GX
0059    *   and OpenType Font Variations, it returns true.
0060    *
0061    *   We use mostly the terminology of the OpenType standard.  Here are some
0062    *   important technical terms.
0063    *
0064    *   * A 'named instance' is a tuple of design coordinates that has a
0065    *     string ID (i.e., an index into the font's 'name' table) associated
0066    *     with it.  The font can tell the user that, for example,
0067    *     [Weight=700,Width=110] is 'Bold'.  Another name for 'named instance'
0068    *     is 'named style'.
0069    *
0070    *       Adobe MM fonts don't have named instances.
0071    *
0072    *   * The 'default instance' of a variation font is that instance for
0073    *     which the nth axis coordinate is equal to the nth default axis
0074    *     coordinate (i.e., `axis[n].def` as specified in the @FT_MM_Var
0075    *     structure), with~n covering all axes.  In TrueType GX and OpenType
0076    *     Font Variations, the default instance is explicitly given.  In Adobe
0077    *     MM fonts, the `WeightVector` entry as found in the font file is
0078    *     taken as the default instance.
0079    *
0080    *       For TrueType GX and OpenType Font Variations, FreeType synthesizes
0081    *       a named instance for the default instance if the font does not
0082    *       contain such an entry.
0083    *
0084    *   * 'Design coordinates' are the axis values found in a variation font
0085    *      file.  Their meaning is specified by the font designer and the
0086    *      values are rather arbitrary.
0087    *
0088    *       For example, the 'weight' axis in design coordinates might vary
0089    *       between 100 (thin) and 900 (heavy) in font~A, while font~B
0090    *       contains values between 400 (normal) and 800 (extra bold).
0091    *
0092    *   * 'Normalized coordinates' are design coordinates mapped to a standard
0093    *     range; they are also called 'blend coordinates'.
0094    *
0095    *       For TrueType GX and OpenType Font Variations, the range is [-1;1],
0096    *       with the minimum mapped to value~-1, the default mapped to
0097    *       value~0, and the maximum mapped to value~1, and all other
0098    *       coordinates mapped to intervening points.  Please look up the
0099    *       [OpenType
0100    *       specification](https://learn.microsoft.com/en-us/typography/opentype/spec/otvaroverview)
0101    *       on how this mapping works in detail.
0102    *
0103    *       For Adobe MM fonts, this standard range is [0;1], with the minimum
0104    *       mapped to value~0 and the maximum mapped to value~1, and all other
0105    *       coordinates mapped to intervening points.  Please look up [Adobe
0106    *       TechNote
0107    *       #5015](https://adobe-type-tools.github.io/font-tech-notes/pdfs/5015.Type1_Supp.pdf)
0108    *       on how this mapping works in detail.
0109    *
0110    *       Assuming that the two fonts in the previous example are OpenType
0111    *       Font Variations, both font~A's [100;900] and font~B's [400;800]
0112    *       coordinate ranges get mapped to [-1;1].
0113    */
0114 
0115 
0116   /**************************************************************************
0117    *
0118    * @enum:
0119    *   T1_MAX_MM_XXX
0120    *
0121    * @description:
0122    *   Adobe MM font limits as defined in their specifications.
0123    *
0124    * @values:
0125    *   T1_MAX_MM_AXIS ::
0126    *     The maximum number of Adobe MM font axes.
0127    *
0128    *   T1_MAX_MM_DESIGNS ::
0129    *     The maximum number of Adobe MM font designs.
0130    *
0131    *   T1_MAX_MM_MAP_POINTS ::
0132    *     The maximum number of elements in a design map.
0133    *
0134    */
0135 #define T1_MAX_MM_AXIS         4
0136 #define T1_MAX_MM_DESIGNS     16
0137 #define T1_MAX_MM_MAP_POINTS  20
0138 
0139 
0140   /**************************************************************************
0141    *
0142    * @struct:
0143    *   FT_MM_Axis
0144    *
0145    * @description:
0146    *   A structure to model a given axis in design space for Adobe MM fonts.
0147    *
0148    *   This structure can't be used with TrueType GX or OpenType Font
0149    *   Variations.
0150    *
0151    * @fields:
0152    *   name ::
0153    *     The axis's name.
0154    *
0155    *   minimum ::
0156    *     The axis's minimum design coordinate.
0157    *
0158    *   maximum ::
0159    *     The axis's maximum design coordinate.
0160    */
0161   typedef struct  FT_MM_Axis_
0162   {
0163     FT_String*  name;
0164     FT_Long     minimum;
0165     FT_Long     maximum;
0166 
0167   } FT_MM_Axis;
0168 
0169 
0170   /**************************************************************************
0171    *
0172    * @struct:
0173    *   FT_Multi_Master
0174    *
0175    * @description:
0176    *   A structure to model the axes and space of an Adobe MM font.
0177    *
0178    *   This structure can't be used with TrueType GX or OpenType Font
0179    *   Variations.
0180    *
0181    * @fields:
0182    *   num_axis ::
0183    *     Number of axes.  Cannot exceed~4.
0184    *
0185    *   num_designs ::
0186    *     Number of designs; should be normally `2^num_axis` even though the
0187    *     Type~1 specification strangely allows for intermediate designs to be
0188    *     present.  This number cannot exceed~16.
0189    *
0190    *   axis ::
0191    *     A table of axis descriptors.
0192    */
0193   typedef struct  FT_Multi_Master_
0194   {
0195     FT_UInt     num_axis;
0196     FT_UInt     num_designs;
0197     FT_MM_Axis  axis[T1_MAX_MM_AXIS];
0198 
0199   } FT_Multi_Master;
0200 
0201 
0202   /**************************************************************************
0203    *
0204    * @struct:
0205    *   FT_Var_Axis
0206    *
0207    * @description:
0208    *   A structure to model a given axis in design space for Adobe MM fonts,
0209    *   TrueType GX, and OpenType Font Variations.
0210    *
0211    * @fields:
0212    *   name ::
0213    *     The axis's name.  Not always meaningful for TrueType GX or OpenType
0214    *     Font Variations.
0215    *
0216    *   minimum ::
0217    *     The axis's minimum design coordinate.
0218    *
0219    *   def ::
0220    *     The axis's default design coordinate.  FreeType computes meaningful
0221    *     default values for Adobe MM fonts.
0222    *
0223    *   maximum ::
0224    *     The axis's maximum design coordinate.
0225    *
0226    *   tag ::
0227    *     The axis's tag (the equivalent to 'name' for TrueType GX and
0228    *     OpenType Font Variations).  FreeType provides default values for
0229    *     Adobe MM fonts if possible.
0230    *
0231    *   strid ::
0232    *     The axis name entry in the font's 'name' table.  This is another
0233    *     (and often better) version of the 'name' field for TrueType GX or
0234    *     OpenType Font Variations.  Not meaningful for Adobe MM fonts.
0235    *
0236    * @note:
0237    *   The fields `minimum`, `def`, and `maximum` are 16.16 fractional values
0238    *   for TrueType GX and OpenType Font Variations.  For Adobe MM fonts, the
0239    *   values are whole numbers (i.e., the fractional part is zero).
0240    */
0241   typedef struct  FT_Var_Axis_
0242   {
0243     FT_String*  name;
0244 
0245     FT_Fixed    minimum;
0246     FT_Fixed    def;
0247     FT_Fixed    maximum;
0248 
0249     FT_ULong    tag;
0250     FT_UInt     strid;
0251 
0252   } FT_Var_Axis;
0253 
0254 
0255   /**************************************************************************
0256    *
0257    * @struct:
0258    *   FT_Var_Named_Style
0259    *
0260    * @description:
0261    *   A structure to model a named instance in a TrueType GX or OpenType
0262    *   Font Variations.
0263    *
0264    *   This structure can't be used for Adobe MM fonts.
0265    *
0266    * @fields:
0267    *   coords ::
0268    *     The design coordinates for this instance.  This is an array with one
0269    *     entry for each axis.
0270    *
0271    *   strid ::
0272    *     An index into the 'name' table identifying this instance.
0273    *
0274    *   psid ::
0275    *     An index into the 'name' table identifying a PostScript name for
0276    *     this instance.  Value 0xFFFF indicates a missing entry.
0277    */
0278   typedef struct  FT_Var_Named_Style_
0279   {
0280     FT_Fixed*  coords;
0281     FT_UInt    strid;
0282     FT_UInt    psid;   /* since 2.7.1 */
0283 
0284   } FT_Var_Named_Style;
0285 
0286 
0287   /**************************************************************************
0288    *
0289    * @struct:
0290    *   FT_MM_Var
0291    *
0292    * @description:
0293    *   A structure to model the axes and space of Adobe MM fonts, TrueType
0294    *   GX, or OpenType Font Variations.
0295    *
0296    *   Some fields are specific to one format and not to the others.
0297    *
0298    * @fields:
0299    *   num_axis ::
0300    *     The number of axes.  The maximum value is~4 for Adobe MM fonts; no
0301    *     limit in TrueType GX or OpenType Font Variations.
0302    *
0303    *   num_designs ::
0304    *     The number of designs; should be normally `2^num_axis` for Adobe MM
0305    *     fonts.  Not meaningful for TrueType GX or OpenType Font Variations
0306    *     (where every glyph could have a different number of designs).
0307    *
0308    *   num_namedstyles ::
0309    *     The number of named instances.  For Adobe MM fonts, this value is
0310    *     always zero.
0311    *
0312    *   axis ::
0313    *     An axis descriptor table.  TrueType GX and OpenType Font Variations
0314    *     contain slightly more data than Adobe MM fonts.  Memory management
0315    *     of this pointer is done internally by FreeType.
0316    *
0317    *   namedstyle ::
0318    *     An array of named instances.  Only meaningful for TrueType GX and
0319    *     OpenType Font Variations.  Memory management of this pointer is done
0320    *     internally by FreeType.
0321    */
0322   typedef struct  FT_MM_Var_
0323   {
0324     FT_UInt              num_axis;
0325     FT_UInt              num_designs;
0326     FT_UInt              num_namedstyles;
0327     FT_Var_Axis*         axis;
0328     FT_Var_Named_Style*  namedstyle;
0329 
0330   } FT_MM_Var;
0331 
0332 
0333   /**************************************************************************
0334    *
0335    * @function:
0336    *   FT_Get_Multi_Master
0337    *
0338    * @description:
0339    *   Retrieve a variation descriptor of a given Adobe MM font.
0340    *
0341    *   This function can't be used with TrueType GX or OpenType Font
0342    *   Variations.
0343    *
0344    * @input:
0345    *   face ::
0346    *     A handle to the source face.
0347    *
0348    * @output:
0349    *   amaster ::
0350    *     The Adobe MM font's variation descriptor.
0351    *
0352    * @return:
0353    *   FreeType error code.  0~means success.
0354    */
0355   FT_EXPORT( FT_Error )
0356   FT_Get_Multi_Master( FT_Face           face,
0357                        FT_Multi_Master  *amaster );
0358 
0359 
0360   /**************************************************************************
0361    *
0362    * @function:
0363    *   FT_Get_MM_Var
0364    *
0365    * @description:
0366    *   Retrieve a variation descriptor for a given font.
0367    *
0368    *   This function works with all supported variation formats.
0369    *
0370    * @input:
0371    *   face ::
0372    *     A handle to the source face.
0373    *
0374    * @output:
0375    *   amaster ::
0376    *     The variation descriptor.  Allocates a data structure, which the
0377    *     user must deallocate with a call to @FT_Done_MM_Var after use.
0378    *
0379    * @return:
0380    *   FreeType error code.  0~means success.
0381    */
0382   FT_EXPORT( FT_Error )
0383   FT_Get_MM_Var( FT_Face      face,
0384                  FT_MM_Var*  *amaster );
0385 
0386 
0387   /**************************************************************************
0388    *
0389    * @function:
0390    *   FT_Done_MM_Var
0391    *
0392    * @description:
0393    *   Free the memory allocated by @FT_Get_MM_Var.
0394    *
0395    * @input:
0396    *   library ::
0397    *     A handle of the face's parent library object that was used in the
0398    *     call to @FT_Get_MM_Var to create `amaster`.
0399    *
0400    * @return:
0401    *   FreeType error code.  0~means success.
0402    */
0403   FT_EXPORT( FT_Error )
0404   FT_Done_MM_Var( FT_Library   library,
0405                   FT_MM_Var   *amaster );
0406 
0407 
0408   /**************************************************************************
0409    *
0410    * @function:
0411    *   FT_Set_MM_Design_Coordinates
0412    *
0413    * @description:
0414    *   For Adobe MM fonts, choose an interpolated font design through design
0415    *   coordinates.
0416    *
0417    *   This function can't be used with TrueType GX or OpenType Font
0418    *   Variations.
0419    *
0420    * @inout:
0421    *   face ::
0422    *     A handle to the source face.
0423    *
0424    * @input:
0425    *   num_coords ::
0426    *     The number of available design coordinates.  If it is larger than
0427    *     the number of axes, ignore the excess values.  If it is smaller than
0428    *     the number of axes, use default values for the remaining axes.
0429    *
0430    *   coords ::
0431    *     An array of design coordinates.
0432    *
0433    * @return:
0434    *   FreeType error code.  0~means success.
0435    *
0436    * @note:
0437    *   [Since 2.8.1] To reset all axes to the default values, call the
0438    *   function with `num_coords` set to zero and `coords` set to `NULL`.
0439    *
0440    *   [Since 2.9] If `num_coords` is larger than zero, this function sets
0441    *   the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
0442    *   (i.e., @FT_IS_VARIATION returns true).  If `num_coords` is zero, this
0443    *   bit flag gets unset.
0444    */
0445   FT_EXPORT( FT_Error )
0446   FT_Set_MM_Design_Coordinates( FT_Face   face,
0447                                 FT_UInt   num_coords,
0448                                 FT_Long*  coords );
0449 
0450 
0451   /**************************************************************************
0452    *
0453    * @function:
0454    *   FT_Set_Var_Design_Coordinates
0455    *
0456    * @description:
0457    *   Choose an interpolated font design through design coordinates.
0458    *
0459    *   This function works with all supported variation formats.
0460    *
0461    * @inout:
0462    *   face ::
0463    *     A handle to the source face.
0464    *
0465    * @input:
0466    *   num_coords ::
0467    *     The number of available design coordinates.  If it is larger than
0468    *     the number of axes, ignore the excess values.  If it is smaller than
0469    *     the number of axes, use default values for the remaining axes.
0470    *
0471    *   coords ::
0472    *     An array of design coordinates.
0473    *
0474    * @return:
0475    *   FreeType error code.  0~means success.
0476    *
0477    * @note:
0478    *   The design coordinates are 16.16 fractional values for TrueType GX and
0479    *   OpenType Font Variations.  For Adobe MM fonts, the values are supposed
0480    *   to be whole numbers (i.e., the fractional part is zero).
0481    *
0482    *   [Since 2.8.1] To reset all axes to the default values, call the
0483    *   function with `num_coords` set to zero and `coords` set to `NULL`.
0484    *   [Since 2.9] 'Default values' means the currently selected named
0485    *   instance (or the base font if no named instance is selected).
0486    *
0487    *   [Since 2.9] If `num_coords` is larger than zero, this function sets
0488    *   the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
0489    *   (i.e., @FT_IS_VARIATION returns true).  If `num_coords` is zero, this
0490    *   bit flag gets unset.
0491    *
0492    *   [Since 2.14] This function also sets the @FT_FACE_FLAG_VARIATION bit
0493    *   in @FT_Face's `face_flags` field (i.e., @FT_IS_VARIATION returns
0494    *   true) if any of the provided coordinates is different from the face's
0495    *   default value for the corresponding axis, that is, the set up face is
0496    *   not at its default position.
0497    */
0498   FT_EXPORT( FT_Error )
0499   FT_Set_Var_Design_Coordinates( FT_Face    face,
0500                                  FT_UInt    num_coords,
0501                                  FT_Fixed*  coords );
0502 
0503 
0504   /**************************************************************************
0505    *
0506    * @function:
0507    *   FT_Get_Var_Design_Coordinates
0508    *
0509    * @description:
0510    *   Get the design coordinates of the currently selected interpolated
0511    *   font.
0512    *
0513    *   This function works with all supported variation formats.
0514    *
0515    * @input:
0516    *   face ::
0517    *     A handle to the source face.
0518    *
0519    *   num_coords ::
0520    *     The number of design coordinates to retrieve.  If it is larger than
0521    *     the number of axes, set the excess values to~0.
0522    *
0523    * @output:
0524    *   coords ::
0525    *     The design coordinates array, which must be allocated by the user.
0526    *
0527    * @return:
0528    *   FreeType error code.  0~means success.
0529    *
0530    * @note:
0531    *   The design coordinates are 16.16 fractional values for TrueType GX and
0532    *   OpenType Font Variations.  For Adobe MM fonts, the values are whole
0533    *   numbers (i.e., the fractional part is zero).
0534    *
0535    * @since:
0536    *   2.7.1
0537    */
0538   FT_EXPORT( FT_Error )
0539   FT_Get_Var_Design_Coordinates( FT_Face    face,
0540                                  FT_UInt    num_coords,
0541                                  FT_Fixed*  coords );
0542 
0543 
0544   /**************************************************************************
0545    *
0546    * @function:
0547    *   FT_Set_MM_Blend_Coordinates
0548    *
0549    * @description:
0550    *   Choose an interpolated font design through normalized coordinates.
0551    *
0552    *   This function works with all supported variation formats.
0553    *
0554    * @inout:
0555    *   face ::
0556    *     A handle to the source face.
0557    *
0558    * @input:
0559    *   num_coords ::
0560    *     The number of available design coordinates.  If it is larger than
0561    *     the number of axes, ignore the excess values.  If it is smaller than
0562    *     the number of axes, use default values for the remaining axes.
0563    *
0564    *   coords ::
0565    *     The normalized coordinates array.  Each element is a 16.16
0566    *     fractional value and must be between 0 and 1.0 for Adobe MM fonts,
0567    *     and between -1.0 and 1.0 for TrueType GX and OpenType Font
0568    *     Variations.
0569    *
0570    * @return:
0571    *   FreeType error code.  0~means success.
0572    *
0573    * @note:
0574    *   [Since 2.8.1] To reset all axes to the default values, call the
0575    *   function with `num_coords` set to zero and `coords` set to `NULL`.
0576    *   [Since 2.9] 'Default values' means the currently selected named
0577    *   instance (or the base font if no named instance is selected).
0578    *
0579    *   [Since 2.9] If `num_coords` is larger than zero, this function sets
0580    *   the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
0581    *   (i.e., @FT_IS_VARIATION returns true).  If `num_coords` is zero, this
0582    *   bit flag gets unset.
0583    *
0584    *   [Since 2.14] This function also sets the @FT_FACE_FLAG_VARIATION bit
0585    *   in @FT_Face's `face_flags` field (i.e., @FT_IS_VARIATION returns
0586    *   true) if any of the provided coordinates is different from the face's
0587    *   default value for the corresponding axis, that is, the set up face is
0588    *   not at its default position.
0589    */
0590   FT_EXPORT( FT_Error )
0591   FT_Set_MM_Blend_Coordinates( FT_Face    face,
0592                                FT_UInt    num_coords,
0593                                FT_Fixed*  coords );
0594 
0595 
0596   /**************************************************************************
0597    *
0598    * @function:
0599    *   FT_Get_MM_Blend_Coordinates
0600    *
0601    * @description:
0602    *   Get the normalized coordinates of the currently selected interpolated
0603    *   font.
0604    *
0605    *   This function works with all supported variation formats.
0606    *
0607    * @input:
0608    *   face ::
0609    *     A handle to the source face.
0610    *
0611    *   num_coords ::
0612    *     The number of normalized coordinates to retrieve.  If it is larger
0613    *     than the number of axes, set the excess values to~0.5 for Adobe MM
0614    *     fonts, and to~0 for TrueType GX and OpenType Font Variations.
0615    *
0616    * @output:
0617    *   coords ::
0618    *     The normalized coordinates array (as 16.16 fractional values), which
0619    *     must be allocated by the user.
0620    *
0621    * @return:
0622    *   FreeType error code.  0~means success.
0623    *
0624    * @since:
0625    *   2.7.1
0626    */
0627   FT_EXPORT( FT_Error )
0628   FT_Get_MM_Blend_Coordinates( FT_Face    face,
0629                                FT_UInt    num_coords,
0630                                FT_Fixed*  coords );
0631 
0632 
0633   /**************************************************************************
0634    *
0635    * @function:
0636    *   FT_Set_Var_Blend_Coordinates
0637    *
0638    * @description:
0639    *   This is another name of @FT_Set_MM_Blend_Coordinates.
0640    */
0641   FT_EXPORT( FT_Error )
0642   FT_Set_Var_Blend_Coordinates( FT_Face    face,
0643                                 FT_UInt    num_coords,
0644                                 FT_Fixed*  coords );
0645 
0646 
0647   /**************************************************************************
0648    *
0649    * @function:
0650    *   FT_Get_Var_Blend_Coordinates
0651    *
0652    * @description:
0653    *   This is another name of @FT_Get_MM_Blend_Coordinates.
0654    *
0655    * @since:
0656    *   2.7.1
0657    */
0658   FT_EXPORT( FT_Error )
0659   FT_Get_Var_Blend_Coordinates( FT_Face    face,
0660                                 FT_UInt    num_coords,
0661                                 FT_Fixed*  coords );
0662 
0663 
0664   /**************************************************************************
0665    *
0666    * @function:
0667    *   FT_Set_MM_WeightVector
0668    *
0669    * @description:
0670    *   For Adobe MM fonts, choose an interpolated font design by directly
0671    *   setting the weight vector.
0672    *
0673    *   This function can't be used with TrueType GX or OpenType Font
0674    *   Variations.
0675    *
0676    * @inout:
0677    *   face ::
0678    *     A handle to the source face.
0679    *
0680    * @input:
0681    *   len ::
0682    *     The length of the weight vector array.  If it is larger than the
0683    *     number of designs, the extra values are ignored.  If it is less than
0684    *     the number of designs, the remaining values are set to zero.
0685    *
0686    *   weightvector ::
0687    *     An array representing the weight vector.
0688    *
0689    * @return:
0690    *   FreeType error code.  0~means success.
0691    *
0692    * @note:
0693    *   Adobe MM fonts limit the number of designs, and thus the length of the
0694    *   weight vector, to 16~elements.
0695    *
0696    *   If `len` is larger than zero, this function sets the
0697    *   @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field (i.e.,
0698    *   @FT_IS_VARIATION returns true).  If `len` is zero, this bit flag is
0699    *   unset and the weight vector array is reset to the default values.
0700    *
0701    *   The Adobe documentation also states that the values in the
0702    *   `WeightVector` array must total 1.0 +/-~0.001.  In practice this does
0703    *   not seem to be enforced, so is not enforced here, either.
0704    *
0705    * @since:
0706    *   2.10
0707    */
0708   FT_EXPORT( FT_Error )
0709   FT_Set_MM_WeightVector( FT_Face    face,
0710                           FT_UInt    len,
0711                           FT_Fixed*  weightvector );
0712 
0713 
0714   /**************************************************************************
0715    *
0716    * @function:
0717    *   FT_Get_MM_WeightVector
0718    *
0719    * @description:
0720    *   For Adobe MM fonts, retrieve the current weight vector of the font.
0721    *
0722    *   This function can't be used with TrueType GX or OpenType Font
0723    *   Variations.
0724    *
0725    * @inout:
0726    *   face ::
0727    *     A handle to the source face.
0728    *
0729    *   len ::
0730    *     A pointer to the size of the array to be filled.  If the size of the
0731    *     array is less than the number of designs, `FT_Err_Invalid_Argument`
0732    *     is returned, and `len` is set to the required size (the number of
0733    *     designs).  If the size of the array is greater than the number of
0734    *     designs, the remaining entries are set to~0.  On successful
0735    *     completion, `len` is set to the number of designs (i.e., the number
0736    *     of values written to the array).
0737    *
0738    * @output:
0739    *   weightvector ::
0740    *     An array to be filled; it must be allocated by the user.
0741    *
0742    * @return:
0743    *   FreeType error code.  0~means success.
0744    *
0745    * @note:
0746    *   Adobe MM fonts limit the number of designs, and thus the length of the
0747    *   weight vector, to~16 elements.
0748    *
0749    * @since:
0750    *   2.10
0751    */
0752   FT_EXPORT( FT_Error )
0753   FT_Get_MM_WeightVector( FT_Face    face,
0754                           FT_UInt*   len,
0755                           FT_Fixed*  weightvector );
0756 
0757 
0758   /**************************************************************************
0759    *
0760    * @enum:
0761    *   FT_VAR_AXIS_FLAG_XXX
0762    *
0763    * @description:
0764    *   A list of bit flags used in the return value of
0765    *   @FT_Get_Var_Axis_Flags.
0766    *
0767    * @values:
0768    *   FT_VAR_AXIS_FLAG_HIDDEN ::
0769    *     The variation axis should not be exposed to user interfaces.
0770    *
0771    * @since:
0772    *   2.8.1
0773    */
0774 #define FT_VAR_AXIS_FLAG_HIDDEN  1
0775 
0776 
0777   /**************************************************************************
0778    *
0779    * @function:
0780    *   FT_Get_Var_Axis_Flags
0781    *
0782    * @description:
0783    *   Get the 'flags' field of an OpenType Variation Axis Record.
0784    *
0785    *   Not meaningful for Adobe MM fonts (`*flags` is always zero).
0786    *
0787    * @input:
0788    *   master ::
0789    *     The variation descriptor.
0790    *
0791    *   axis_index ::
0792    *     The index of the requested variation axis.
0793    *
0794    * @output:
0795    *   flags ::
0796    *     The 'flags' field.  See @FT_VAR_AXIS_FLAG_XXX for possible values.
0797    *
0798    * @return:
0799    *   FreeType error code.  0~means success.
0800    *
0801    * @since:
0802    *   2.8.1
0803    */
0804   FT_EXPORT( FT_Error )
0805   FT_Get_Var_Axis_Flags( FT_MM_Var*  master,
0806                          FT_UInt     axis_index,
0807                          FT_UInt*    flags );
0808 
0809 
0810   /**************************************************************************
0811    *
0812    * @function:
0813    *   FT_Set_Named_Instance
0814    *
0815    * @description:
0816    *   Set or change the current named instance.
0817    *
0818    * @input:
0819    *   face ::
0820    *     A handle to the source face.
0821    *
0822    *   instance_index ::
0823    *     The index of the requested instance, starting with value~1.  If set
0824    *     to value~0, FreeType switches to font access without a named
0825    *     instance.
0826    *
0827    * @return:
0828    *   FreeType error code.  0~means success.
0829    *
0830    * @note:
0831    *   The function uses the value of `instance_index` to set bits 16-30 of
0832    *   the face's `face_index` field.  It also resets any variation applied
0833    *   to the font, and the @FT_FACE_FLAG_VARIATION bit of the face's
0834    *   `face_flags` field gets reset to zero (i.e., @FT_IS_VARIATION returns
0835    *   false).
0836    *
0837    *   For Adobe MM fonts, this function resets the current face to the
0838    *   default instance.
0839    *
0840    * @since:
0841    *   2.9
0842    */
0843   FT_EXPORT( FT_Error )
0844   FT_Set_Named_Instance( FT_Face  face,
0845                          FT_UInt  instance_index );
0846 
0847 
0848   /**************************************************************************
0849    *
0850    * @function:
0851    *   FT_Get_Default_Named_Instance
0852    *
0853    * @description:
0854    *   Retrieve the index of the default named instance, to be used with
0855    *   @FT_Set_Named_Instance.
0856    *
0857    *   FreeType synthesizes a named instance for the default instance if the
0858    *   font does not contain such an entry.
0859    *
0860    * @input:
0861    *   face ::
0862    *     A handle to the source face.
0863    *
0864    * @output:
0865    *   instance_index ::
0866    *     The index of the default named instance.
0867    *
0868    * @return:
0869    *   FreeType error code.  0~means success.
0870    *
0871    * @note:
0872    *   For Adobe MM fonts, this function always returns zero for
0873    *   `instance_index`.
0874    *
0875    * @since:
0876    *   2.13.1
0877    */
0878   FT_EXPORT( FT_Error )
0879   FT_Get_Default_Named_Instance( FT_Face   face,
0880                                  FT_UInt  *instance_index );
0881 
0882   /* */
0883 
0884 
0885 FT_END_HEADER
0886 
0887 #endif /* FTMM_H_ */
0888 
0889 
0890 /* END */