TTFFont

Implementation for SDL_ttf.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

dispose
void dispose()

Deallocates memory and invalidates this.

load
void load(string file, int sizeInPt)

Loads the font from a file.

measureText
vec2 measureText(string text, float scale = 1.0f)

Returns the dimensions of a string with this font.

measureTextMultiline
vec2 measureTextMultiline(string text, float scale = 1.0f)

Returns the dimensions of a multiline string with this font.

render
IText render(string text, float scale = 1.0f)

Renders a string to an IText.

renderMultiline
IText renderMultiline(string text, float scale = 1.0f)

Renders a multiline string to an IText.

Properties

handle
TTF_Font* handle [@property getter]

Handle to underlying TTF_Font* handle.

lineHeight
float lineHeight [@property getter]

Returns the line height of this font.

valid
bool valid [@property getter]

Returns if _handle is not null.

Meta