lovr.graphics.newFont

Creates a new Font. It can be used to render text with lovr.graphics.print.

Currently, the only supported font format is TTF.

font = lovr.graphics.newFont(filename, size)

Arguments

NameTypeDefaultDescription
filenamestringThe filename of the font file.
sizenumber32The size of the font, in pixels.

Returns

NameTypeDescription
fontFontThe new Font.

Creates a new Font from the default font included with LÖVR (Cabin).

font = lovr.graphics.newFont(size)

Arguments

NameTypeDefaultDescription
sizenumber32The size of the font, in pixels.

Returns

NameTypeDescription
fontFontThe new Font.

font = lovr.graphics.newFont(rasterizer)

Arguments

NameTypeDescription
rasterizerRasterizerThe existing Rasterizer object used to render the glyphs.

Returns

NameTypeDescription
fontFontThe new Font.

Notes

Larger font sizes will lead to more detailed curves at the cost of performance.

See also