@mocanvas/mocanvas · function

estimateTextSize

declare function estimateTextSize(text: string, fontSize: number, maxWidth?: number): TextSizeEstimate

Estimate the box a run of text occupies at fontSize, wrapping each paragraph at maxWidth using an average character width.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.