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:
17
rendertext_example.lua
Normal file
17
rendertext_example.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
require "rendertext"
|
||||
|
||||
fb = einkfb.open("/dev/fb0")
|
||||
width, height = fb:getSize()
|
||||
|
||||
print("open")
|
||||
|
||||
face = freetype.newBuiltinFace("Helvetica", 64)
|
||||
print("got face")
|
||||
|
||||
renderUtf8Text(100,100,face,"h","Hello World! äöü")
|
||||
|
||||
fb:refresh()
|
||||
|
||||
while true do
|
||||
local ev = input.waitForEvent()
|
||||
end
|
||||
Reference in New Issue
Block a user