Class: Font

Font(size, style, variant, weight, family, horizontalAlignment)

Holds attributes controlling the style, size and other attributes of Text shapes and the textual features of Placemark and other shapes. The values used for these attributes are those defined by the CSS Font property.

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