Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Font

Font class lets you create a specific font style with properties for its size and style

Hierarchy

  • Font

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new Font(size?: number, face?: string, weight?: string, style?: string, lineHeight?: number): Font
  • Create a font style

    example

    new Font(12, "Frutiger, sans-serif", "bold", "underline", 1.5)

    Parameters

    • Default value size: number = 12

      font size. Defaults is 12px.

    • Default value face: string = "sans-serif"

      Optional font-family, use css-like string such as "Helvetica" or "Helvetica, sans-serif". Default is "sans-serif".

    • Default value weight: string = ""

      Optional font weight such as "bold". Default is "" (none).

    • Default value style: string = ""

      Optional font style such as "italic". Default is "" (none).

    • Default value lineHeight: number = 1.5

      Optional line height. Default is 1.5.

    Returns Font

Properties

face

face: string

lineHeight

lineHeight: number

size

size: number

style

style: string

weight

weight: string

Accessors

value

  • get value(): string
  • Get a string representing the font style, in css-like string such as "italic bold 12px/1.5 sans-serif"

    Returns string

Methods

toString

  • toString(): string
  • Get a string representing the font style, in css-like string such as "italic bold 12px/1.5 sans-serif"

    Returns string

Generated using TypeDoc