layout
const layout: (...args) => Effect<LayoutResult, EffectMotionError, never>;
Variable: layout
const layout: (...args) => Effect<LayoutResult, EffectMotionError, never>;Defined in: packages/renderer/src/Text.ts:135
Lay out a string into a renderer-neutral LayoutResult.
Parameters
| Parameter | Type |
|---|---|
...args | [Text, LayoutRequest] |
Returns
Effect<LayoutResult, EffectMotionError, never>
Remarks
Shapes and positions the glyphs with the anchor and baseline offsets applied. By default the text's baseline-left sits at local (0, 0). Coordinates are y-up layout units, axis-identical to scene space.
Layout failures arrive as typed errors naming the font. The font must be registered first — an unregistered font is a defect.