Font
You may render text with a call to Renderer.draw_font.
open
construct open(filename, size, aa, unicode_start, unicode_end)
Parameters
filename -> StringFilename of the .ttf to use.size -> NumHeight in pixels the font should be.aa -> BoolWhether or not to use an anti-aliasing filter.unicode_start -> NumStarting character of the unicode range the image includes (inclusive).unicode_end -> NumEnding character of the unicode range the image includes (inclusive).
Creates a new font from a .ttf file.
size
size(string)
Parameters
string -> StringString to check the size of.
Returns a list of [w, h] representing the width and height of the string if it were to be rendered.
size_wrapped
size_wrapped(string, width)
Parameters
string -> StringString to check the size of.width -> NumWidth of the string before wrapping.
Returns a list of [w, h] representing the width and height of the string if it were to be rendered wrapped.
size_ext
size_ext(string)
Parameters
string -> StringString to check the size of.
Returns a list of [w, h] representing the width and height of the string if it were to be rendered. Ignores tokens, see draw_font_ext.
size_ext_wrapped
size_ext_wrapped(string, width)
Parameters
string -> StringString to check the size of.width -> NumWidth of the string before wrapping.
Returns a list of [w, h] representing the width and height of the string if it were to be rendered wrapped. Ignores tokens, see draw_font_ext_wrapped.
free
free()
Forces a font to be freed from memory without waiting for the garbage collector.