klyn.gui.windows.Painter.measureFont
method
public measureFont() as TextMetrics
Description

Returns native ascent, descent and recommended line height for this font. Unlike measureText's documented estimates, these values come from the selected font face. Width is zero: no text run is measured by this call.

Returns

Font metrics in pixels; height may differ from ascent+descent.

Throws
  • IOException when a native font backend is unavailable.
Example

painter.font = "16px Arial"; metrics = painter.measureFont()