measureText

fnvoid measureText(string text, out int width, out int height)

Measures the width and height of a string.

This measures the bounding box of the string, accounting for multiple lines if newlines are present.

Parameters

textText to measure
widthOutput for width in pixels
heightOutput for height in pixels Example:
font(Font.helvetica, 12);
int w, h;
measureText("Hello\nWorld", w, h);