klyn.gui.windows.Painter.measureTextWidth
method

    public measureTextWidth(text as String) as Double:

Description

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.

Parameters

Parameter | Description
--- | ---
`text` | Text to measure with the current `font`.

Returns

Horizontal text advance in logical pixels.

Example

    painter = Painter(320, 120)
    painter.font = "16px Segoe UI"
    width = painter.measureTextWidth("Klyn")