API reference

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

C

classTextStyle

@codexo/exojs / rendering / stable

Describes how a Text node renders its string. Every setter marks the style dirty with a StyleChangeHint so that the owning node can batch-rebuild efficiently on the next frame: - `'tint'` - only updates `Mesh.tint`, no atlas work - `'layout'` - rebuilds the glyph mesh, reuses cached atlas glyphs - `'font'` - atlas lookup + full mesh rebuild Call consumeDirty at the start of each frame to get the accumulated hint and clear the flag.

25
props
3
methods
1
events
Import
import { TextStyle } from '@codexo/exojs'

Describes how a Text node renders its string.

Every setter marks the style dirty with a StyleChangeHint so that the owning node can batch-rebuild efficiently on the next frame: - `'tint'` - only updates `Mesh.tint`, no atlas work - `'layout'` - rebuilds the glyph mesh, reuses cached atlas glyphs - `'font'` - atlas lookup + full mesh rebuild

Call consumeDirty at the start of each frame to get the accumulated hint and clear the flag.

Constructors1
Methods3
Return a new TextStyle with all properties copied from this one.
Returns the accumulated StyleChangeHint and clears the dirty flag, or null if nothing has changed since the last call. Call this once per frame from the owning node's layout pass.
Copy all properties from style into this instance and return this.
Properties25
decorationOffset: number
Extra downward offset in pixels applied to both rules.
decorationThickness: number
Rule thickness in pixels; 0 derives it from the font size.
Runtime fill color applied as Mesh.tint. Glyphs are always rasterized white; this color multiplies them at draw time without touching the atlas.
font: string
CSS font shorthand used as CanvasRenderingContext2D.font during glyph rasterization.
fontFamily: string
The typeface, slant, weight and caps variant this style selects, as the key a glyph atlas, a metrics cache or a line shaper is resolved by.
fontSize: number
Multi-stop fill gradient, or null when the glyph interior takes fillColor. Read back normalized: stops cloned, offsets clamped to 0..1 and sorted, angle resolved. Assigning re-normalizes, so the object handed in is never aliased and mutating it afterwards changes nothing.
leading: number
Extra pixel gap between lines, added on top of lineHeight.
lineHeight: number
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
shadowOffsetX: number
shadowOffsetY: number
strikethrough: boolean
Rule through each line.
Case mapping applied before layout. Changing it re-flows the text; the node's text is untouched.
underline: boolean
Rule under each line. Rebuilds the geometry: a rule is a quad of its own.
Events1
Source