public measureTextWidth(text as String) as Double:
Measures only the horizontal advance of a text run.
This allocation-free variant is intended for layout engines that do not need ascent or descent metrics.
| Parameter | Description |
|---|---|
text | Text to measure with the current font. |
Horizontal text advance in logical pixels.
painter = Painter(320, 120)
painter.font = "16px Segoe UI"
width = painter.measureTextWidth("Klyn")