FreeType-2.1.10 API Reference
Multiple Masters
Synopsis
#FT_MM_Axis
FT_MM_Axis
#FT_Get_MM_Var
FT_Get_MM_Var
#FT_Multi_Master
FT_Multi_Master
#FT_Set_MM_Design_Coordinates
FT_Set_MM_Design_Coordinates
#FT_Var_Axis
FT_Var_Axis
#FT_Set_Var_Design_Coordinates
FT_Set_Var_Design_Coordinates
#FT_Var_Named_Style
FT_Var_Named_Style
#FT_Set_MM_Blend_Coordinates
FT_Set_MM_Blend_Coordinates
#FT_MM_Var
FT_MM_Var
#FT_Set_Var_Blend_Coordinates
FT_Set_Var_Blend_Coordinates
#FT_Get_Multi_Master
FT_Get_Multi_Master
The following types and functions are used to manage Multiple Master fonts, i.e. the selection of specific design instances by setting design axis coordinates.
George Williams has extended this interface to make it work with both Type 1 Multiple Masters fonts, and GX distortable (var) fonts. Some of these routines only work with MM fonts, others will work with both types. They are similar enough that a consistent interface makes sense.
FT_MM_Axis
typedef
struct
FT_MM_Axis_
{
ft2-basic_types.html#FT_String
FT_String
*  name;
ft2-basic_types.html#FT_Long
FT_Long
minimum;
ft2-basic_types.html#FT_Long
FT_Long
maximum;
}
FT_MM_Axis
;
A simple structure used to model a given axis in design space for Multiple Masters fonts.
This structure can't be used for GX var fonts.
fields
name
The axis's name.
minimum
The axis's minimum design coordinate.
maximum
The axis's maximum design coordinate.
FT_Multi_Master
typedef
struct
FT_Multi_Master_
{
ft2-basic_types.html#FT_UInt
FT_UInt
num_axis;
ft2-basic_types.html#FT_UInt
FT_UInt
num_designs;
ft2-multiple_masters.html#FT_MM_Axis
FT_MM_Axis
axis[T1_MAX_MM_AXIS];
}
FT_Multi_Master
;
A structure used to model the axes and space of a Multiple Masters font.
This structure can't be used for GX var fonts.
fields
num_axis
Number of axes. Cannot exceed 4.
num_designs
Number of designs; should ne normally 2^num_axis even though the Type 1 specification strangely allows for intermediate designs to be present. This number cannot exceed 16.
axis
A table of axis descriptors.
FT_Var_Axis
typedef
struct
FT_Var_Axis_
{
ft2-basic_types.html#FT_String
FT_String
*  name;
ft2-basic_types.html#FT_Fixed
FT_Fixed
minimum;
ft2-basic_types.html#FT_Fixed
FT_Fixed
def;
ft2-basic_types.html#FT_Fixed
FT_Fixed
maximum;
ft2-basic_types.html#FT_ULong
FT_ULong
tag;
ft2-basic_types.html#FT_UInt
FT_UInt
strid;
}
FT_Var_Axis
;
A simple structure used to model a given axis in design space for Multiple Masters and GX var fonts.
fields
name
The axis's name. Not always meaningful for GX.
minimum
The axis's minimum design coordinate.
def
The axis's default design coordinate. FreeType computes meaningful default values for MM; it is then an integer value, not in 16.16 format.
maximum
The axis's maximum design coordinate.
tag
The axis's tag (the GX equivalent to `name'). FreeType provides default values for MM if possible.
strid
The entry in `name' table (another GX version of `name'). Not meaningful for MM.
FT_Var_Named_Style
typedef
struct
FT_Var_Named_Style_
{
ft2-basic_types.html#FT_Fixed
FT_Fixed
*  coords;
ft2-basic_types.html#FT_UInt
FT_UInt
strid;
}
FT_Var_Named_Style
;
A simple structure used to model a named style in a GX var font.
This structure can't be used for MM fonts.
fields
coords
The design coordinates for this style. This is an array with one entry for each axis.
strid
The entry in `name' table identifying this style.
FT_MM_Var
typedef
struct
FT_MM_Var_
{
ft2-basic_types.html#FT_UInt
FT_UInt
num_axis;
ft2-basic_types.html#FT_UInt
FT_UInt
num_designs;
ft2-basic_types.html#FT_UInt
FT_UInt
num_namedstyles;
ft2-multiple_masters.html#FT_Var_Axis
FT_Var_Axis
*         axis;
ft2-multiple_masters.html#FT_Var_Named_Style
FT_Var_Named_Style
*  namedstyle;
}
FT_MM_Var
;
A structure used to model the axes and space of a Multiple Masters or GX var distortable font.
Some fields are specific to one format and not to the other.
fields
num_axis
The number of axes. The maximum value is 4 for MM; no limit in GX.
num_designs
The number of designs; should be normally 2^num_axis for MM fonts. Not meaningful for GX (where every glyph could have a different number of designs).
num_namedstyles
The number of named styles; only meaningful for GX which allows certain design coordinates to have a string ID (in the `name' table) associated with them. The font can tell the user that, for example, Weight=1.5 is `Bold'.
axis
A table of axis descriptors. GX fonts contain slightly more data than MM.
namedstyles
A table of named styles. Only meaningful with GX.
FT_Get_Multi_Master
FT_EXPORT(
ft2-basic_types.html#FT_Error
FT_Error
)
FT_Get_Multi_Master
(
ft2-base_interface.html#FT_Face
FT_Face
face,
ft2-multiple_masters.html#FT_Multi_Master
FT_Multi_Master
*amaster );
Retrieves the Multiple Master descriptor of a given font.
This function can't be used with GX fonts.
input
face
A handle to the source face.
output
amaster
The Multiple Masters descriptor.
return
FreeType error code. 0 means success.
FT_Get_MM_Var
FT_EXPORT(
ft2-basic_types.html#FT_Error
FT_Error
)
FT_Get_MM_Var
(
ft2-base_interface.html#FT_Face
FT_Face
face,
ft2-multiple_masters.html#FT_MM_Var
FT_MM_Var
*  *amaster );
Retrieves the Multiple Master/GX var descriptor of a given font.
input
face
A handle to the source face.
output
amaster
The Multiple Masters descriptor. Allocates a data structure, which the user must free (a single call to FT_FREE will do it).
return
FreeType error code. 0 means success.
FT_Set_MM_Design_Coordinates
FT_EXPORT(
ft2-basic_types.html#FT_Error
FT_Error
)
FT_Set_MM_Design_Coordinates
(
ft2-base_interface.html#FT_Face
FT_Face
face,
ft2-basic_types.html#FT_UInt
FT_UInt
num_coords,
ft2-basic_types.html#FT_Long
FT_Long
*  coords );
For Multiple Masters fonts, choose an interpolated font design through design coordinates.
This function can't be used with GX fonts.
inout
face
A handle to the source face.
input
num_coords
The number of design coordinates (must be equal to the number of axes in the font).
coords
An array of design coordinates.
return
FreeType error code. 0 means success.
FT_Set_Var_Design_Coordinates
FT_EXPORT(
ft2-basic_types.html#FT_Error
FT_Error
)
FT_Set_Var_Design_Coordinates
(
ft2-base_interface.html#FT_Face
FT_Face
face,
ft2-basic_types.html#FT_UInt
FT_UInt
num_coords,
ft2-basic_types.html#FT_Fixed
FT_Fixed
*  coords );
For Multiple Master or GX Var fonts, choose an interpolated font design through design coordinates.
inout
face
A handle to the source face.
input
num_coords
The number of design coordinates (must be equal to the number of axes in the font).
coords
An array of design coordinates.
return
FreeType error code. 0 means success.
FT_Set_MM_Blend_Coordinates
FT_EXPORT(
ft2-basic_types.html#FT_Error
FT_Error
)
FT_Set_MM_Blend_Coordinates
(
ft2-base_interface.html#FT_Face
FT_Face
face,
ft2-basic_types.html#FT_UInt
FT_UInt
num_coords,
ft2-basic_types.html#FT_Fixed
FT_Fixed
*  coords );
For Multiple Masters and GX var fonts, choose an interpolated font design through normalized blend coordinates.
inout
face
A handle to the source face.
input
num_coords
The number of design coordinates (must be equal to the number of axes in the font).
coords
The design coordinates array (each element must be between 0 and 1.0).
return
FreeType error code. 0 means success.
FT_Set_Var_Blend_Coordinates
FT_EXPORT(
ft2-basic_types.html#FT_Error
FT_Error
)
FT_Set_Var_Blend_Coordinates
(
ft2-base_interface.html#FT_Face
FT_Face
face,
ft2-basic_types.html#FT_UInt
FT_UInt
num_coords,
ft2-basic_types.html#FT_Fixed
FT_Fixed
*  coords );
This is another name of
ft2-multiple_masters.html#FT_Set_MM_Blend_Coordinates
FT_Set_MM_Blend_Coordinates
.
