creating a font with faulty data now throws an exception; error handler now wraps error text if it's too long

This commit is contained in:
bill@Ixion
2009-08-28 20:45:20 -05:00
parent 0e0c7527b1
commit 5850700c8e
4 changed files with 65 additions and 54 deletions
@@ -210,7 +210,12 @@ namespace opengl
// Second optional parameter can be a number:
int size = luaL_optint(L, 2, 12);
Font * font = instance->newFont(d, size);
Font * font;
try {
font = instance->newFont(d, size);
} catch (Exception & e) {
return luaL_error(L, e.what());
}
if(font == 0)
return luaL_error(L, "Could not load the font");