Skip to content

measureText

measureText(text, font): object

Defined in: labels/measure.ts:34

Measure a label’s screen box (CSS px) for collision. font is a canvas font shorthand (no /line-height — strip it first). Width is measured; height is the font size × 1.25 (a consistent row box; 11px → 14, matching the estimates this replaces).

string

string

object

height: number

width: number