Skip to content

vyaz-monorepo / core/src / AutofitConfig

Interface: AutofitConfig ​

Defined in: core/src/types/Document.ts:230

Configuration for automatic font-size reduction (autofit).

When enabled is true, the layout engine will scale down the font size of all runs proportionally so the text fits inside the frame's width × height. The scaling stops at minFontSize.

Example ​

ts
{ enabled: true, minFontSize: 10, maxFontSize: 24, baseFontSize: 18 }

See ​

TextFrame.autofit

Properties ​

baseFontSize? ​

optional baseFontSize?: number

Defined in: core/src/types/Document.ts:250

Base font size used as a reference when TextRun.fontSize is interpreted as a relative scale factor.

Todo ​

Currently TextRun.fontSize is absolute px. In future it may be a ratio relative to this base.


enabled ​

enabled: boolean

Defined in: core/src/types/Document.ts:232

Whether autofit is active.


maxFontSize? ​

optional maxFontSize?: number

Defined in: core/src/types/Document.ts:242

Maximum font size in px. The engine will never grow text above this threshold.


minFontSize? ​

optional minFontSize?: number

Defined in: core/src/types/Document.ts:237

Minimum font size in px. The engine will never shrink text below this threshold.

Released under the MIT License.