modern-pdf-lib / computeFontSize
Function: computeFontSize()
computeFontSize(
text,options):number
Defined in: src/core/layout.ts:130
Compute the largest font size (in points) at which text fits within the given width (and optionally height) constraints.
Uses binary search between minSize (default 4) and maxSize (default 500), converging to within 0.1 pt.
Parameters
text
string
options
Returns
number