MotionScript

@motion-script/core


@motion-script/core / TextState

Interface: TextState

Defined in: render/descriptors/text.ts:33

Per-shape descriptor state. Shapes carry geometry and a local transform (rotation/scale baked into the path before it joins the union) but not layer effects: effects are applied to the whole drawn union via Graphics.effects, not per shape. So ShapeState omits TransformState.effects (which remains for node-level transforms).

Extends

Properties

blend?

optional blend?: "color" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "luminosity" | "normal" | "pass-through"

Defined in: render/descriptors/transform.ts:12

Layer blend mode. 'pass-through' (the default) does not isolate the node; any other mode isolates it and blends its flattened result against the backdrop. Optional so per-shape descriptors that extend this state needn't carry it.

Inherited from

TransformState.blend


end

end: number

Defined in: render/descriptors/shape.ts:14

Inherited from

ShapeState.end


fontFamily

fontFamily: string

Defined in: render/descriptors/text.ts:36


fontSize

fontSize: number | "autofit"

Defined in: render/descriptors/text.ts:35


fontStyle

fontStyle: FontStyle

Defined in: render/descriptors/text.ts:38


fontWeight

fontWeight: number

Defined in: render/descriptors/text.ts:37


height

height: number

Defined in: render/descriptors/text.ts:45

Overrides

TransformState.height


letterSpacing

letterSpacing: number

Defined in: render/descriptors/text.ts:39


lineHeight

lineHeight: number

Defined in: render/descriptors/text.ts:40


minFontSize

minFontSize: number

Defined in: render/descriptors/text.ts:43


opacity

opacity: number

Defined in: render/descriptors/transform.ts:10

Inherited from

TransformState.opacity


path?

optional path?: PathData | null

Defined in: render/descriptors/text.ts:58

When set, the text is wrapped around this path (text-on-path) instead of laid out as straight lines: each glyph is positioned and rotated to follow the path, centered on its baseline, and glyphs past the path end are clipped. Mutually exclusive with segments in v1.


pivot

pivot: Anchor

Defined in: render/descriptors/shape.ts:22

Pivot for the shape's local rotation/scale. Widened from a Vector2 to a Anchor so a shape can pivot about a named anchor (.rect({ pivot: 'topRight' })) as well as an explicit Vector2. with*Descriptor normalises it to a Vector2 (via resolveShapePivot), so the resolved state the renderer reads always carries a concrete pivot.

Inherited from

ShapeState.pivot


rotation

rotation: number

Defined in: render/descriptors/transform.ts:13

Inherited from

TransformState.rotation


scale

scale: number

Defined in: render/descriptors/transform.ts:14

Inherited from

TransformState.scale


segments?

optional segments?: TextSegment[]

Defined in: render/descriptors/text.ts:51

Per-piece overrides when the node has active text selections. When set, the renderer shapes these pieces together (one paragraph) and paints each shaped run with its piece's overrides instead of the node's single fill.


start

start: number

Defined in: render/descriptors/shape.ts:13

Inherited from

ShapeState.start


text

text: string

Defined in: render/descriptors/text.ts:34


textAlign

textAlign: TextAlign

Defined in: render/descriptors/text.ts:41


width

width: number

Defined in: render/descriptors/text.ts:44

Overrides

TransformState.width


wrap

wrap: boolean

Defined in: render/descriptors/text.ts:42


x

x: number

Defined in: render/descriptors/transform.ts:6

Inherited from

TransformState.x


y

y: number

Defined in: render/descriptors/transform.ts:7

Inherited from

TransformState.y