Canvasity.setFont

Set the font to use for text drawing.

The font must be a TrueType font (TTF) file which has been loaded or mapped into memory. Following some basic validation, the relevant sections of the font file contents are copied, and it is safe to change or destroy after this call. As an optimization, calling this with either a null pointer or zero for the number of bytes will allow for changing the size of the previous font without recopying from the file. Note that the font parsing is not meant to be secure; only use this with trusted TTF files!

Parameters

font const(ubyte)*

Contents of a TrueType font (TTF) file.

bytes int

Number of bytes in the font file.

size float

Size in pixels per em to draw at.

Return Value

Type: bool

true if the font was set successfully.

Meta