OptionalalignHorizontal text alignment. Defaults to "center".
OptionalbackgroundBackground fill as a CSS color string, or "transparent". Defaults to "transparent".
OptionalcolorFill color as a CSS color string. Defaults to "#ffffff". Ignored if gradient is set.
OptionalfontCSS font family name. Defaults to "sans-serif".
OptionalfontFont size in pixels. Defaults to 48.
OptionalfontCSS font-stretch value (keyword or percentage), drives the "wdth" axis of a variable font.
OptionalfontURL of a font file (e.g. a variable font) to load and register under fontFamily before drawing.
OptionalfontRaw CSS font-variation-settings value for custom variable font axes beyond weight/stretch/
italic. Applied best-effort via CanvasRenderingContext2D.fontVariationSettings where the
browser supports it; silently ignored otherwise.
OptionalfontNumeric font weight, also drives the "wght" axis of a variable font. Defaults to 400.
OptionalgradientLinear gradient fill, replaces color.
OptionalitalicWhether to render in italic, drives the "ital"/"slnt" axis of a variable font.
OptionalletterExtra spacing between characters in pixels.
OptionallineLine height multiplier relative to fontSize. Defaults to 1.2.
OptionalmaxMaximum line width in pixels before wrapping. Unset means no wrapping.
OptionaloutlineOutline (stroke) effect.
OptionalpaddingPadding around the text in pixels. Defaults to 24.
OptionalpixelSupersampling factor for a sharper texture. Defaults to 2.
OptionalshadowDrop-shadow effect.
The text to render. Explicit "\n" characters start a new line.
Configuration options for a TextTexture.