@mocanvas/mocanvas · interface
interface TextMeasureHtmlOptionsThis one ships without a description. The signature above is read from the package, and the guides cover the area it belongs to.
Properties · 9
fontFamily: stringfontSize: numberfontStyle?: stringCSS font-style, e.g. "italic".
fontWeight?: string | numberlineHeight: numberUnitless line height (multiplier of the font size).
maxWidth?: number | nullWrap width in CSS px, including padding. Omit (or null) for no wrapping.
measureScrollWidth?: booleanAlso report scrollWidth, with the DOM property's meaning: the width the
content *cannot* be made to fit in. Text that wraps reports the wrap width;
only something unbreakable — one long word, a URL — reports more.
That distinction is the whole point of asking: a shrink-to-fit pass tells "wraps" (fine, keep this size) from "overflows" (too big, shrink) by comparing it against the wrap width.
otherStyles?: Record<string, string>Extra CSS declarations applied to the probe, e.g. { "font-variant": "small-caps" }.
padding?: number | stringCSS padding, as a number of px or any padding shorthand ("0px", "4px 8px").
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.