@mocanvas/mocanvas · interface
interface TextTextureSpecThis one ships without a description. The signature above is read from the package, and the guides cover the area it belongs to.
Properties · 14
align?: TextTextureAlign@deprecated v5 renamed this to textAlign.
color: stringAny CSS color string.
fontFamily: stringfontSize: numberheight: numberlineHeight: numberUnitless line-height multiplier.
maxWidth?: numberSoft-wrap width in page units. Omit for no wrapping (one line per paragraph).
padding?: numberPadding inside the box, in page units.
resolution: numberDevice pixels per page unit the canvas is rasterized at, i.e.
dpr × min(4, zoom). Callers bucket it to a power of two
(bucketTextureResolution / editor.getTextureResolution()) so zooming
does not re-rasterize every frame.
richText?: RichTextSourceThe label as a rich-text document. When present the raster is drawn run by run, so bold, italic, underlined and struck-through spans keep their formatting on the GPU path rather than only in the DOM overlay.
text: stringThe label as plain text. Ignored when TextTextureSpec.richText is
set; derived from it when only richText is given.
textAlign?: TextTextureAlignHorizontal alignment. Named align before v5; align is still accepted.
verticalAlign: TextTextureAlignwidth: numberThe box the texture covers, in page units — the shape's local geometry bounds.
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.