@mocanvas/mocanvas · interface

NoteShapeUtilDisplayValues

interface NoteShapeUtilDisplayValues extends TLDefaultDisplayValues

What a note paints with, once its style props have been resolved.

Wider than the shared set because a note is not a filled rectangle with a label on it: its body colour comes from the palette's *note* tokens rather than from a fill style, and its label has a padding and a typography of its own that anything measuring the note has to agree with. Callers read them through getDisplayValues(util, note), which is the only place the live theme and colour mode are consulted.

noteWidth and noteHeight are the note's **logical square**, before growY. That is deliberate: the square is the note's identity, and a caller fitting text into it wants the box the text has to fit, not the box the text already grew.


Properties · 10

labelBaseFontSize: number

The label's font size in page units *before* fontSizeAdjustment: the size style, scaled. The denominator that adjustment is a fraction of.

labelFontFamily: string

The label's CSS font stack.

labelFontSize: number

The label's font size in page units, after any fontSizeAdjustment.

labelFontStyle: string

The label's CSS font-style.

labelFontVariant: string

The label's CSS font-variant.

labelFontWeight: string

The label's CSS font-weight.

labelLineHeight: number

The label's CSS line-height, as a unitless multiple of the font size.

labelPadding: number

Padding on every side between the body edge and its label, in page units.

noteHeight: number

The body's height in page units before growY; equal to noteWidth.

noteWidth: number

The body's width in page units, scale applied.

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.