2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
koreader/rendertext_example.lua

28 lines
517 B
Lua
Executable File

#!./kpdfview
require "rendertext"
require "graphics"
fb = einkfb.open("/dev/fb0")
width, height = fb:getSize()
print("open")
face = freetype.newBuiltinFace("sans", 64)
--face = freetype.newFace("test.ttf", 64)
print("got face")
if face:hasKerning() then
print("has kerning")
end
fb.bb:paintRect(1,1,599,300,7);
renderUtf8Text(fb.bb, 100, 100, face, "h", "AV T.T: gxyt!", true)
renderUtf8Text(fb.bb, 100, 200, face, "h", "AV T.T: gxyt!", false)
fb:refresh()
while true do
local ev = input.waitForEvent()
end