Canvasity.stroke_text

Draw a line of text by stroking its outline.

This behaves as though the current path were reset to the outline of the given text in the current font and size, positioned relative to the given anchor point according to the current alignment and baseline, and then stroked as usual. However, the current path is not actually changed. The current transform at the time that this is called will affect the given anchor point and the text outline. However, the comparison to the maximum width in pixels and the condensing if needed is done before applying the current transform. The maximum width (if given) must be positive. If it is not, or the text pointer is null, or the font has not been set yet, or the last setting of it was unsuccessful, or the current transform is not invertible, this does nothing.

Parameters

text const(char)*

Null-terminated UTF-8 string to stroke.

x float

Horizontal coordinate of the anchor point.

y float

Vertical coordinate of the anchor point.

maxWidth float

Horizontal width to condense wider text to.

Meta