UI module

draw_text

procedure · 1 overloadsince 0.31.0Source

Draw one line of text with its top left at (x, y) and return its width in points.

draw_text :: (
    ui: *UI_State,
    x: float,
    y: float,
    text: string,
    style: Text_Style
) -> float

Draw one line of text with its top left at (x, y) and return its width in points.

Parameters

ui: *UI_State
the UI whose display list gets the glyphs.
x: float
left edge of the line.
y: float
top edge of the line.
text: string
the UTF-8 text. Control characters other than tab are skipped.
style: Text_Style
font, size and colour.

Returns

float

See also