Provides OpenType variations, simulated bold / slant, and additional font settings like OpenType features and extra spacing.
To use simulated bold font variant:
To set the coordinate of multiple variation axes:
Base font used to create a variation. If not set, default Theme font is used.
Extra baseline offset (as a fraction of font height).
A set of OpenType feature tags. More info: OpenType feature tags.
Extra spacing at the bottom of the line in pixels.
Extra spacing between graphical glyphs.
Extra width of the space glyphs.
Extra spacing at the top of the line in pixels.
If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
Note: Emboldened fonts might have self-intersecting outlines, which will prevent MSDF fonts and TextMesh from working correctly.
Active face index in the TrueType / OpenType collection file.
Font OpenType variation coordinates. More info: OpenType variation tags.
Note: This Dictionary uses OpenType tags as keys. Variation axes can be identified both by tags (int, e.g. 0x77678674
) and names (String, e.g. wght
). Some axes might be accessible by multiple names. For example, wght
refers to the same axis as weight
. Tags on the other hand are unique. To convert between names and tags, use TextServer.name_to_tag and TextServer.tag_to_name.
Note: To get available variation axes of a font, use Font.get_supported_variation_list.
2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs.
For example, to simulate italic typeface by slanting, apply the following transform Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)
.
Sets the spacing for spacing
(see SpacingType) to value
in pixels (not relative to the font size).