@mocanvas/editor · interface

EditorTextMeasureHtmlOptions

interface EditorTextMeasureHtmlOptions

Options for measuring a block of HTML. Distinct from EditorTextMeasureOptions: padding is a CSS string here because the measurer sets it on a real element, and otherStyles is applied verbatim.


Properties · 9

fontFamily: string
fontSize: number
fontStyle?: string
fontWeight?: string | number
lineHeight: number

Unitless line height (multiplier of the font size).

maxWidth?: number

Wrap width in CSS px. Omit for a single unwrapped run.

measureScrollWidth?: boolean

Also report the unwrapped content width as scrollWidth.

otherStyles?: Record<string, string>

Extra CSS declarations set on the probe element.

padding?: string

CSS padding shorthand, e.g. "0px" — included in the returned w/h.

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.