Skip to content

vyaz-monorepo / core/src / findScale

Function: findScale() ​

findScale(doc, layoutFn, config, options?): AutoFitResult

Defined in: core/src/layout/AutoFitEngine.ts:95

Find the optimal scale factor for a document.

Parameters ​

doc ​

TextFrame

— source document

layoutFn ​

(scaledDoc) => object

— layout(doc) →

config ​

— autofit maxWidth/maxHeight

maxHeight ​

number

maxWidth ​

number

options? ​

AutoFitOptions

— search precision

Returns ​

AutoFitResult

Released under the MIT License.