klyn.gui.windows.Painter.measureTextWidth
method
public measureTextWidth(text as String) as Double
Description

Measures only the horizontal advance of a text run.

This variant avoids allocating a managed TextMetrics result when only the advance is needed. Native font and shaping caches may allocate.

Parameters
ParameterDescription
textText 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")