Skip to content
pixi-silk
GitHub repository
Interface

TextMeasurer

import type { TextMeasurer } from 'pixi-silk/text';

Widths of characters at the size being laid out, in local units.

Methods#

advance()#

advance(char: string): number;

Advance width of one character, without kerning or letter spacing.

Parameters#

ParameterType
charstring

Returns#

number


kerning()#

kerning(a: string, b: string): number;

Extra space between two characters (negative pulls them together).

Parameters#

ParameterType
astring
bstring

Returns#

number