Skip to main content

Txt

Creates a text.

constructor(text: string | Array<string | IText>)

new Txt('Hello world!').end;

preserveLeadingSpaces(): Txt

preserves leading spaces (by default, leading spaces are removed).

new Txt('     ...').preserveLeadingSpaces().end;

opacity(opacity: number): Txt

Adds text opacity from 0 to 1.

new Txt('...').opacity(0.5).end;

Types

IText

Text properties (extends from IStyleDefinition).

  • readonly text: string | (string | IText)[];
  • readonly preserveLeadingSpaces?: boolean;
  • readonly opacity?: number;