Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Font

Describes how text is displayed

Hierarchy

  • Font

Implements

Index

Constructors

constructor

  • Initializes a new instance of the Font class.

    Parameters

    • fontFamily: string

      The font family.

    • fontWeight: FontWeight

      The font weight.

    • fontStyle: FontStyle

      The font style.

    • fontStretch: FontStretch

      The font stretch.

    • size: number

      The font size.

    • foreground: Brush

      The foreground.

    • textDecorations: ArrayLike<TextDecoration>

      The text decorations.

    Returns Font

Properties

fontFamily

fontFamily: string

Gets or sets the which font family will be used to display the text. Be aware that some font families don't support all characters.

fontStretch

fontStretch: FontStretch

Can be used to render the text stretched or dense.

fontStyle

fontStyle: FontStyle

Gets or sets the the font style.

fontWeight

fontWeight: FontWeight

Gets or sets the the font weight.

foreground

foreground: Brush

Gets or sets the brush which is used to fill the text.

size

size: number

Gets or sets the font size in millimeters. PiWeb will automatically calculate the appropriate font size from the specified height.

textDecorations

textDecorations: TextDecoration[]

Gets or sets the text decorations.

Methods

Private serialize

  • serialize(target: BufferWriter): void
  • Parameters

    • target: BufferWriter

    Returns void

Static create

  • Returns the font that is defined by the specified description.

    Parameters

    Returns Font

Static getFontFamilies

  • getFontFamilies(): string[]
  • Returns a list with the names of all available font families on the host system.

    Returns string[]

Generated using TypeDoc