aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/graphics/je_lua_ttf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/modules/graphics/je_lua_ttf.cpp')
-rw-r--r--src/lua/modules/graphics/je_lua_ttf.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/lua/modules/graphics/je_lua_ttf.cpp b/src/lua/modules/graphics/je_lua_ttf.cpp
index caa1e53..ead46de 100644
--- a/src/lua/modules/graphics/je_lua_ttf.cpp
+++ b/src/lua/modules/graphics/je_lua_ttf.cpp
@@ -22,28 +22,28 @@ namespace JinEngine
return 0;
}
- /* typeset(Text | string, lineheight, spacing) */
+ /* typeset(Text | string, lineheight, spacing) */
LUA_IMPLEMENT int l_typeset(lua_State* L)
{
LuaObject* luaTTF = (LuaObject*)luax_checktype(L, 1, Jin_Lua_TTF);
- TTF* ttf = luaTTF->getObject<TTF>();
+ TTF* ttf = luaTTF->getObject<TTF>();
int lineheight = luax_optnumber(L, 3, ttf->getFontSize());
int spacing = luax_optnumber(L, 4, 0);
- Page* page = nullptr;
- if (luax_isstring(L, 2))
- {
- unsigned length;
- const char* str = luax_checklstring(L, 2, &length);
- Text text(Encode::UTF8, str, length);
- page = ttf->typeset(text, lineheight, spacing);
- }
- else if (luax_istype(L, 2, Jin_Lua_Text))
- {
- LuaObject* luaText = (LuaObject*)luax_checktype(L, 2, Jin_Lua_Text);
- Text* text = luaText->getObject<Text>();
- page = ttf->typeset(*text, lineheight, spacing);
- }
- Shared* refPage = new Shared(page);
+ Page* page = nullptr;
+ if (luax_isstring(L, 2))
+ {
+ unsigned length;
+ const char* str = luax_checklstring(L, 2, &length);
+ Text text(Encode::UTF8, str, length);
+ page = ttf->typeset(text, lineheight, spacing);
+ }
+ else if (luax_istype(L, 2, Jin_Lua_Text))
+ {
+ LuaObject* luaText = (LuaObject*)luax_checktype(L, 2, Jin_Lua_Text);
+ Text* text = luaText->getObject<Text>();
+ page = ttf->typeset(*text, lineheight, spacing);
+ }
+ Shared* refPage = new Shared(page);
LuaObject* luaPage = luax_newinstance(L, Jin_Lua_Page, refPage);
luaPage->setDependency((int)PageDependency::DEP_TTF, luaTTF);
return 1;