Constructor
new Font(size, style, variant, weight, family, horizontalAlignment)
Construct a font descriptor. See the individual attribute descriptions below for possible parameter values.
Parameters:
Name | Type | Description |
---|---|---|
size |
Number | The size of font. |
style |
String | The style of the font. |
variant |
String | The variant of the font. |
weight |
String | The weight of the font. |
family |
String | The family of the font. |
horizontalAlignment |
String | The vertical alignment of the font. |
- Source:
Members
family :String
The font family.
See CSS font-family for defined values.
Type:
- String
- Default Value:
- "sans-serif"
- Source:
fontString
A string representing this font's style, weight, size and family properties, suitable for
passing directly to a 2D canvas context.
- Source:
horizontalAlignment :String
The horizontal alignment of the font.
Recognized values are "left", "center" and "right".
Type:
- String
- Default Value:
- "center"
- Source:
size :Number
The font size.
Type:
- Number
- Source:
style :String
The font style.
See CSS font-style for defined values.
Type:
- String
- Default Value:
- "normal"
- Source:
variant :String
The font variant.
See CSS font-variant for defined values.
Type:
- String
- Default Value:
- "normal"
- Source:
weight :String
The font weight.
See CSS font-weight for defined values.
Type:
- String
- Default Value:
- "normal"
- Source:
Methods
toString() → {String}
Returns a string representation of this object.
- Source:
Returns:
A string representation of this object.
- Type
- String