@mcut/compositor
MeasureFn
Generated TypeScript API reference for the public mcut SDK.
mcut SDK / compositor/src / MeasureFn
Type Alias: MeasureFn
type MeasureFn = (text, font, letterSpacingPx?) => number;Defined in: packages/compositor/src/text.ts:9
Width of text drawn with font and letterSpacingPx of tracking.
Implementations should set ctx.letterSpacing when the engine supports it
so measurement matches drawing; engines without it ignore the parameter
(and the renderer draws without tracking — consistent both ways).
Parameters
text
string
font
string
letterSpacingPx?
number
Returns
number