Added an optional spacing argument to love.graphics.newImageFont, allowing additional spacing (positive or negative) to be applied to all glyphs rendered using that font.

This commit is contained in:
Alex Szpakowski
2015-03-11 18:28:22 -03:00
parent b1f4beac56
commit a119e6a862
6 changed files with 28 additions and 19 deletions
@@ -339,9 +339,13 @@ int w_newImageFont(lua_State *L)
// Convert to Rasterizer if necessary.
if (!luax_istype(L, 1, FONT_RASTERIZER_ID))
{
luaL_checkstring(L, 2);
int idxs[] = {1, 2};
luax_convobj(L, idxs, 2, "font", "newImageRasterizer");
luaL_checktype(L, 2, LUA_TSTRING);
std::vector<int> idxs;
for (int i = 0; i < lua_gettop(L); i++)
idxs.push_back(i + 1);
luax_convobj(L, &idxs[0], (int) idxs.size(), "font", "newImageRasterizer");
}
love::font::Rasterizer *rasterizer = luax_checktype<love::font::Rasterizer>(L, 1, FONT_RASTERIZER_ID);