Module font
Lua bindings to interact with fonts.
Functions
__gc (font) | Frees a font. |
__eq (f1, f2) | Compares two fonts to see if they are the same. |
new (fontname[, Number=1.]) | Gets a font. |
height (f) | Gets the height of a font. |
width (f, text) | Gets the width of some text for a font. |
setFilter (font, min[, mag]) | Sets the font minification and magnification filters. |
addFallback (font, filename[, prefix=""]) | Adds a fallback to a font. |
Functions
- __gc (font)
-
Frees a font.
Parameters:
- font Font Font to free.
- __eq (f1, f2)
-
Compares two fonts to see if they are the same.
Parameters:
- f1 Font Font 1 to compare.
- f2 Font Font 2 to compare.
Returns:
-
boolean
true if both fonts are the same.
- new (fontname[, Number=1.])
-
Gets a font.
Parameters:
- fontname String or Number Name of the font.
- Number size Font height. (default 1.)
Returns:
- Font A newly created font.
- String Name of the newly created font.
- String Prefix of the newly created font.
- height (f)
-
Gets the height of a font.
Parameters:
- f Font Font to get the height of.
Returns:
-
number
Height of the font.
- width (f, text)
-
Gets the width of some text for a font.
Parameters:
- f Font Font to use.
- text string Text to get width of.
Returns:
-
number
Height of the font.
- setFilter (font, min[, mag])
-
Sets the font minification and magnification filters.
Parameters:
- addFallback (font, filename[, prefix=""])
-
Adds a fallback to a font.
Parameters: