Interface: TextMeasurer
Experimental
Low-level measuring backend: widths and vertical metrics at a font size of 1 px. Results are cached by the oracle, so implementations need not cache.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
kind | readonly | string | Experimental 'canvas', 'fallback', or a custom name (for debugging). |
Methods
vertical()
ts
vertical(face): FontVerticalMetrics;Experimental
Ascent/descent at 1 px.
Parameters
| Parameter | Type |
|---|---|
face | TextFace |
Returns
width()
ts
width(text, face): number;Experimental
Advance width of a single line of text at 1 px.
Parameters
| Parameter | Type |
|---|---|
text | string |
face | TextFace |
Returns
number