mirror of
https://github.com/ctruLua/ctruLua.git
synced 2025-10-27 16:39:29 +00:00
Added ctr.gfx.text and the Bitsream Vera font
This commit is contained in:
parent
2dcb9c6aa0
commit
7edb1e2f7b
19 changed files with 385 additions and 4 deletions
23
source/font.c
Normal file
23
source/font.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include <sftd.h>
|
||||
#include "vera_ttf.h"
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
|
||||
sftd_font *font_default;
|
||||
|
||||
static const struct luaL_Reg font_lib[] = {
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
int luaopen_font_lib(lua_State *L) {
|
||||
luaL_newlib(L, font_lib);
|
||||
|
||||
font_default = sftd_load_font_mem(vera_ttf, vera_ttf_size); // Load default font
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void load_font_lib(lua_State *L) {
|
||||
luaL_requiref(L, "ctr.gfx.font", luaopen_font_lib, false);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue