wrapWidths
Returns the width of each line a greedy word wrap at a width produces, measured in the face the text will be set in.
@internote/canvas-sdkOn this page
import { wrapWidths } from '@internote/canvas-sdk';A single word wider than the limit stands on its own line, overrunning, rather than being broken mid-word. Empty text gives no lines.
#Signature
(text: string, px: number, maxWidth: number, family?: string): number[]#Parameters
textThe text to wrap.
pxThe font size in pixels.
maxWidthThe width to wrap at, in pixels.
familyThe CSS font stack.
Declared in packages/canvas-sdk/src/text/index.ts:133.