Set the font.
If a string is given, the font family is set.
If an object is given, the fontFamily
, fontSize
and fontStyle
properties of that object are set.
Important: The font name must be quoted if it contains certain combinations of digits or special characters:
Text.setFont('"Press Start 2P"');
Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all quoted properly, too:
Text.setFont('Georgia, "Goudy Bookletter 1911", Times, serif');
name | type | description |
---|---|---|
font | string |
The font family or font settings to set. |
This Text object.