vyaz-monorepo / core/src / LayoutOptions
Interface: LayoutOptions
Defined in: core/src/layout/TextFrameLayoutEngine.ts:160
Options for layoutTextFrame.
Properties
autofit?
optionalautofit?:boolean| {minFontSize?:number; }
Defined in: core/src/layout/TextFrameLayoutEngine.ts:178
Shrink every run's fontSize proportionally until the content fits the frame box. true uses defaults; an object bounds the minimum size. The chosen scale is reported on result.autofit.
glyphAdvances?
optionalglyphAdvances?:boolean
Defined in: core/src/layout/TextFrameLayoutEngine.ts:166
Fill Span.glyphAdvances on every text span. Needed only by the SVG glyph preset and by caret hit-testing; off by default because it costs O(chars) font lookups + allocation on every layout.
markMissingGlyphs?
optionalmarkMissingGlyphs?:boolean
Defined in: core/src/layout/TextFrameLayoutEngine.ts:201
Fill Span.notdefRanges on every text span — the character ranges no registered font covers. The SVG glyph preset always does this (it resolves the same font anyway); set this to get it for the flat / browser / preserve presets, which renderToSVG({ missingGlyph: 'box' }) reads to draw an explicit placeholder instead of passing the raw code point to the viewer's fallback. Cheap: a cmap lookup per character, no glyph objects.
mode?
optionalmode?:"browser"|"office"
Defined in: core/src/layout/TextFrameLayoutEngine.ts:172
Metric mode for this layout, overriding the provider's global mode:
'browser'(default) — CSS/Chrome line-box, hhea ascent/descent'office'— PowerPoint/DrawingML line-box, OS/2 winAscent/winDescent
onMissingFont?
optionalonMissingFont?:"throw"|"substitute"
Defined in: core/src/layout/TextFrameLayoutEngine.ts:185
What to do when none of a run's fontFamily entries are registered:
'throw'(default) — raiseFontNotFoundError'substitute'— use any registered family and add aresult.warningsentry instead of failing
shaping?
optionalshaping?:boolean
Defined in: core/src/layout/TextFrameLayoutEngine.ts:192
Measure widths through fontkit's layout() — GPOS kerning + GSUB ligatures, i.e. what a browser paints — instead of the default per-code-point advance sum. Applies to line breaking and positioning for this call only. Leave off unless the output is consumed by a browser (SVG browser preset).
