A Font
represents a single font variant at a specific size.
new Font()
This will create a new Font
.
style
: stringDefault: normal
The font style; should be any valid CSS font-style
value.
variant
: stringDefault: normal
The font variant; should be any valid CSS font-variant
value.
weight
: numberDefault: 400
The font weight; should be any valid CSS font-weight
value.
stretch
: stringDefault: normal
The font stretch; should be any valid CSS font-stretch
value.
size
: numberDefault: 16
The font size in pixels.
family
: stringDefault: serif
The font family; should be any valid CSS font-family
value.
toString()
: stringThis will combine the font’s properties into a single string, to be used with the CSS font
property (or as a canvas font
, for that matter).