![]() |
naev 0.12.5
|
Handles fonts. More...
#include "nlua_font.h"#include "ndata.h"#include "nluadef.h"
Go to the source code of this file.
Functions | |
| static int | fontL_gc (lua_State *L) |
| Frees a font. | |
| static int | fontL_eq (lua_State *L) |
| Compares two fonts to see if they are the same. | |
| static int | fontL_new (lua_State *L) |
| Gets a font. | |
| static int | fontL_height (lua_State *L) |
| Gets the height of a font. | |
| static int | fontL_width (lua_State *L) |
| Gets the width of some text for a font. | |
| static int | fontL_setFilter (lua_State *L) |
| Sets the font minification and magnification filters. | |
| static int | fontL_addFallback (lua_State *L) |
| Adds a fallback to a font. | |
| int | nlua_loadFont (nlua_env env) |
| Loads the font library. | |
| glFont * | lua_tofont (lua_State *L, int ind) |
| Lua bindings to interact with fonts. | |
| glFont * | luaL_checkfont (lua_State *L, int ind) |
| Gets font at index or raises error if there is no font at index. | |
| glFont * | lua_pushfont (lua_State *L, glFont font) |
| Pushes a font on the stack. | |
| int | lua_isfont (lua_State *L, int ind) |
| Checks to see if ind is a font. | |
Variables | |
| static const luaL_Reg | fontL_methods [] |
Handles fonts.
Definition in file nlua_font.c.
|
static |
Adds a fallback to a font.
Lua function parameter: Font font Font to set fallback to. Lua function parameter: string filename Name of the font to add. Lua function parameter:[opt=""] string prefix Prefix to use for the fonts.
| L | Lua State |
Lua function: addFallback
Definition at line 251 of file nlua_font.c.
|
static |
Compares two fonts to see if they are the same.
Lua function parameter: Font f1 Font 1 to compare. Lua function parameter: Font f2 Font 2 to compare. Lua return parameter: boolean true if both fonts are the same.
| L | Lua State |
Lua function: __eq
Definition at line 137 of file nlua_font.c.
|
static |
Frees a font.
Lua function parameter: Font font Font to free.
| L | Lua State |
Lua function: __gc
Definition at line 123 of file nlua_font.c.
|
static |
Gets the height of a font.
Lua function parameter: Font f Font to get the height of. Lua return parameter: number Height of the font.
| L | Lua State |
Lua function: height
Definition at line 192 of file nlua_font.c.
|
static |
Gets a font.
Lua function parameter: String|Number fontname Name of the font. Lua function parameter:[opt=1.] size Number Font height. Lua return parameter: Font A newly created font. Lua return parameter: String Name of the newly created font. Lua return parameter: String Prefix of the newly created font.
| L | Lua State |
Lua function: new
Definition at line 156 of file nlua_font.c.
|
static |
Sets the font minification and magnification filters.
Lua function parameter: Font font Font to set filter. Lua function parameter: string min Minification filter ("nearest" or "linear") Lua function parameter:[opt] string mag Magnification filter ("nearest" or "linear"). Defaults to min.
| L | Lua State |
Lua function: setFilter
Definition at line 225 of file nlua_font.c.
|
static |
Gets the width of some text for a font.
Lua function parameter: Font f Font to use. Lua function parameter: string text Text to get width of. Lua return parameter: number Height of the font.
| L | Lua State |
Lua function: width
Definition at line 207 of file nlua_font.c.
| int lua_isfont | ( | lua_State * | L, |
| int | ind ) |
Checks to see if ind is a font.
| L | Lua state to check. |
| ind | Index position to check. |
Definition at line 101 of file nlua_font.c.
Pushes a font on the stack.
| L | Lua state to push font into. |
| font | Font to push. |
Definition at line 86 of file nlua_font.c.
| glFont * lua_tofont | ( | lua_State * | L, |
| int | ind ) |
Lua bindings to interact with fonts.
Lua module: font
Gets font at index.
| L | Lua state to get font from. |
| ind | Index position to find the font. |
Definition at line 61 of file nlua_font.c.
| glFont * luaL_checkfont | ( | lua_State * | L, |
| int | ind ) |
Gets font at index or raises error if there is no font at index.
| L | Lua state to get font from. |
| ind | Index position to find font. |
Definition at line 72 of file nlua_font.c.
| int nlua_loadFont | ( | nlua_env | env | ) |
Loads the font library.
| env | Environment to load font library into. |
Definition at line 43 of file nlua_font.c.
|
static |
Font metatable methods.
Definition at line 27 of file nlua_font.c.