Skip to content

Function: measureLayout() ​

measureLayout(paragraphs, innerWidthPt, resolve, fontScalePct, lnSpcReductionPct, widthSafety?): LayoutResult | null

Lay out paragraphs at a given scale/reduction and return the total height (points) and wrapped line count, or null if any paragraph is unmeasurable. Errs tall (conservative): includes space-before/after and the calibrated line pitch. The single source of truth for both measureHeightPt (the solvers) and the public layout-time measure API.

Parameters ​

ParameterTypeDefault value
paragraphsFitParagraph[]undefined
innerWidthPtnumberundefined
resolveMetricsResolverundefined
fontScalePctnumberundefined
lnSpcReductionPctnumberundefined
widthSafetynumber1

Returns ​

LayoutResult | null