mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
added freetype text rendering (still buggy)
this allows to render glyphs and also brings a simple engine for rendering UTF-8 strings onto the framebuffer. blitting to uneven offset is implemented here, too, but needs more work and is still buggy. In the end, this will allow for a simple GUI.
This commit is contained in:
14
blitbuffer.c
14
blitbuffer.c
@@ -30,6 +30,18 @@ static int newBlitBuffer(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int getWidth(lua_State *L) {
|
||||
BlitBuffer *bb = (BlitBuffer*) luaL_checkudata(L, 1, "blitbuffer");
|
||||
lua_pushinteger(L, bb->w);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int getHeight(lua_State *L) {
|
||||
BlitBuffer *bb = (BlitBuffer*) luaL_checkudata(L, 1, "blitbuffer");
|
||||
lua_pushinteger(L, bb->h);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int freeBlitBuffer(lua_State *L) {
|
||||
BlitBuffer *bb = (BlitBuffer*) luaL_checkudata(L, 1, "blitbuffer");
|
||||
|
||||
@@ -43,6 +55,8 @@ static const struct luaL_reg blitbuffer_func[] = {
|
||||
};
|
||||
|
||||
static const struct luaL_reg blitbuffer_meth[] = {
|
||||
{"getWidth", getWidth},
|
||||
{"getHeight", getHeight},
|
||||
{"free", freeBlitBuffer},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user