API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfaceTextStyleOptions

@codexo/exojs / rendering / stable

Construction-time options for a TextStyle. All properties are optional; defaults match the TextStyle constructor.

24
props
0
methods
0
events
Import
import { TextStyleOptions } from '@codexo/exojs'

Construction-time options for a TextStyle. All properties are optional; defaults match the TextStyle constructor.

Properties24
Rule colour. null (the default) takes the fill, gradient included, so a gradient-filled label gets a gradient-filled rule.
decorationOffset?: number
Extra downward offset in pixels applied to both rules, on top of the position the font's metrics put them at. Defaults to 0.
decorationThickness?: number
Rule thickness in pixels. 0 (the default) derives it from the font size.
font?: FontFace
A pre-constructed FontFace to use as the font for this node. When passed to Text, the face is automatically registered with document.fonts. Load the face via FontFactory before constructing the node so glyphs render immediately. Takes precedence over fontFamily when both are set. ts const face = await loader.load(Asset.type('font', 'roboto.woff2', { family: 'Roboto' })); const label = new Text('Score: 0', { font: face, fontSize: 24 });
fontFamily?: string
fontSize?: number
CSS font-weight. Defaults to 'normal' so that single-weight custom fonts render without browser-synthesised bold artefacts. Set explicitly to 'bold' for display / title text that intentionally requires bold.
Multi-stop fill gradient. When set it overrides fillColor for the glyph interior; null disables it. The ramp spans the ink extent (getLocalBounds()), not the advance box.
leading?: number
Extra pixel gap between lines, added on top of lineHeight.
lineHeight?: number
Multiplier of fontSize for the distance between lines. Default 1.2 - not a pixel value.
outlineWidth?: number
Outline width in SDF units (0..0.5). 0 disables the outline.
shadowAlpha?: number
Shadow opacity (0..1). 0 disables the shadow.
shadowBlur?: number
Shadow blur softness (0..1). Larger values soften the shadow edge.
shadowOffsetX?: number
Horizontal shadow offset in pixels.
shadowOffsetY?: number
Vertical shadow offset in pixels.
strikethrough?: boolean
Draw a rule through each line. Defaults to false.
Case mapping applied before layout. Defaults to 'none'. The mapping is Unicode-aware and never touches the node's text: reading it back gives the string that was assigned, so a transformed label stays editable and a caret still lands where the reader clicked. 'capitalize' uppercases the first grapheme cluster of each word and leaves the rest of the word alone, matching CSS. Word boundaries and the case mapping both follow locale when LayoutOptions.locale sets one.
underline?: boolean
Draw a rule under each line. Defaults to false.
Source