Skip to content

vyaz-monorepo / core/src / TextFrameLayoutResult

Interface: TextFrameLayoutResult

Defined in: core/src/layout/TextFrameLayoutEngine.ts:38

Result of laying out a full TextFrame.

fitHorizontal / fitVertical tell the renderer which dimension to use:

  • 'frame' → use frameWidth / frameHeight
  • 'content' → use contentWidth / contentHeight

Properties

autofit?

optional autofit?: AutofitOutcome

Defined in: core/src/layout/TextFrameLayoutEngine.ts:55

Present when autofit ran — the scale applied and whether it bottomed out.


content

content: object

Defined in: core/src/layout/TextFrameLayoutEngine.ts:41

Intrinsic content box — the text bounding box.

height

height: number

width

width: number


fit

fit: object

Defined in: core/src/layout/TextFrameLayoutEngine.ts:53

Which size a renderer should use per axis: 'frame' when a frame size was provided, otherwise 'content'.

horizontal

horizontal: "frame" | "content"

vertical

vertical: "frame" | "content"


frame

frame: object

Defined in: core/src/layout/TextFrameLayoutEngine.ts:43

Frame box as given on the input; an axis is omitted when its size was not set.

height?

optional height?: number

width?

optional width?: number


lines

lines: Line[]

Defined in: core/src/layout/TextFrameLayoutEngine.ts:39


overflow

overflow: object

Defined in: core/src/layout/TextFrameLayoutEngine.ts:48

Whether content spills past the frame on each axis. false for an axis with no frame size. Use it to decide auto-grow vs clip vs autofit.

horizontal

horizontal: boolean

vertical

vertical: boolean


transform?

optional transform?: FrameTransform

Defined in: core/src/layout/TextFrameLayoutEngine.ts:67

Post-layout rigid transform to realise writingMode: 'sideways-*' and/or TextFrame.rotation. Omitted when the net rotation is a multiple of 360° (nothing to apply). lines, content bbox aside, live in pre-rotation layout space; content / overflow are reported in visual space.


warnings?

optional warnings?: LayoutWarning[]

Defined in: core/src/layout/TextFrameLayoutEngine.ts:69

Non-fatal issues (font fallback / substitution). Omitted when empty.


writingMode

writingMode: WritingMode

Defined in: core/src/layout/TextFrameLayoutEngine.ts:60

Block flow direction this layout was produced for — echoes TextFrame.writingMode, defaulting to 'horizontal-tb'.

Released under the MIT License.