Skip to content
Shapemetry

Model - Text styles

API reference for src/lanes/textStyles/textStyles on @huukhanhnguyen/model, reachable from ..

See the Guide for the ModelJSON / evaluate pipeline.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

collectTextStyles

function

Evaluate every textStyles[] node on the scope (the ONE entry consumers should use — Model.evaluateTextStyles wraps this in a SnapshotLaneNode).

collectTextStyles(scope: ModelScope): TextStyle[]

evaluateTextStyleNode

function

Evaluate one textStyle node. Null when the name cannot be resolved.

evaluateTextStyleNode(node: Operation, context: ReturnType<typeof laneParameterContext>, namespaces?: Record<string, unknown>): TextStyle | null

isTextStyleNode

function

True when node is a non-container operation with method "textStyle".

isTextStyleNode(node: (Operation | Container)): node is Operation

TEXT_STYLE_METHOD

const

textStyles lane — evaluation of textStyle nodes into resolved TextStyle records.

Same shape as the layers lane next door (node entries, identity in a quoted name arg, expression fields resolved against the live parameter scope): consumers read RESOLVED {name, font?, height, …} by name, never re-implementing evaluation.

Fail-soft per node, matching layers/materials/styles: a node with no resolvable name is skipped rather than breaking the render. A style NAME that resolves to no record is a different failure and is NOT soft — see resolveTextStyle in nodeMethods/annotation.ts, which throws.

const TEXT_STYLE_METHOD: "textStyle"
Last updated: 📖 1 min readEdit on GitHub