A font variation is a setting along a variation axis that allows your application to produce a range of typestyles algorithmically. Each variation axis has:
A name (such as 'wght') that indicates the typestyle that the axis represents, specified in the font variation axis dictionary using the key kCGFontVariationAxisName.
A set of maximum and minimum values for the axis, specified in the font variation axis dictionary using the keys kCGFontVariationAxisMinValue and kCGFontVariationAxisMaxValue.
The default value of the axis, specified in the font variation axis dictionary using the key kCGFontVariationAxisDefaultValue.
The weight axis, for example, governs the possible values for the weight of the font—the minimum value produces the lightest appearance of that font, the maximum value the boldest. The default value is the position along the variation axis at which that font falls normally. Because the axis is created by the font designer, font variations can be optimized for their particular font. Not all fonts have variations.
Quartz provides three functions in Mac OS X v10.4 that let you work with font variations:
CGFontCreateCopyWithVariations, which creates a copy of a font using a variation specification dictionary. The function returns a font created by applying the specified variation specification dictionary to the font you provide.
CGFontCopyVariations, which returns a dictionary that contains the font variations, or NULL if the font doesn’t support variations.
CGFontCopyVariationAxes, which returns an array of variation axis dictionaries, or NULL if the font doesn’t support variations.
Last updated: 2007-12-11