Class: TextStyle

TextStyle

Members

TextStyle.trim boolean static

See TextStyle.trim

Default Value:
  • false

_fill ConvertedFillStyle

_stroke ConvertedStrokeStyle

align 'left' | 'center' | 'right' | 'justify'

Default Value:
  • "left"

breakWords boolean

See TextStyle.breakWords

Default Value:
  • false

dropShadow TextDropShadow

See TextStyle.dropShadow

fill string | Array<string> | number | Array<number> | CanvasGradient | CanvasPattern

Default Value:
  • "black"

fontFamily string | Array<string>

Default Value:
  • "Arial"

fontSize number | string

Default Value:
  • 26

fontStyle 'normal' | 'italic' | 'oblique'

Default Value:
  • "normal"

fontVariant 'normal' | 'small-caps'

Default Value:
  • "normal"

fontWeight 'normal' | 'bold' | 'bolder' | 'lighter' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'

Default Value:
  • "normal"

leading number

See TextStyle.leading

Default Value:
  • 0

letterSpacing number

See TextStyle.letterSpacing

Default Value:
  • 0

lineHeight number

See TextStyle.lineHeight

Default Value:
  • 0

padding number

See TextStyle.padding

Default Value:
  • 0

stroke string | number

Default Value:
  • undefined

textBaseline 'alphabetic' | 'top' | 'hanging' | 'middle' | 'ideographic' | 'bottom'

Default Value:
  • "alphabetic"

whiteSpace 'normal' | 'pre' | 'pre-line'

Default Value:
  • "pre"

wordWrap boolean

See TextStyle.wordWrap

Default Value:
  • false

wordWrapWidth number

See TextStyle.wordWrapWidth

Default Value:
  • 100

Methods

destroy (options)

Destroys this text style.

Name Type Attributes Default Description
options TypeOrBool<TextureDestroyOptions> false

Options parameter. A boolean will act as if all options have been set to that value

options.texture boolean <optional>
false

Should it destroy the texture of the this style

options.textureSource boolean <optional>
false

Should it destroy the textureSource of the this style