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

2 Commits

Author SHA1 Message Date
Tigran Aivazian
379cba7b68 Pass the boolean kerning to renderUtf8Text()
The last argument of renderUtf8Text() accepts only boolean values of
`kerning`.
2012-10-07 11:27:55 +01:00
HW
b6d75b84ec Added widget abstraction framework
An example for using it:

--snip
require "widget"
require "font"

fb = einkfb.open("/dev/fb0")
G_width, G_height = fb:getSize()

dialog = CenterContainer:new({
        dimen = { w = G_width, h = G_height },
        VerticalGroup:new({
                align = "center",
                FrameContainer:new({
                        CenterContainer:new({
                                dimen = { w = 400, h = 200 },
                                TextWidget:new({
                                        text = "Hi there! jgVJV",
                                        face = Font:getFace("cfont", 30)
                                })
                        })
                }),
                ImageWidget:new({
                        file = "test.png"
                }),
                FrameContainer:new({
                        CenterContainer:new({
                                dimen = { w = 300, h = 200 },
                                TextWidget:new({
                                        text = "another box",
                                        face = Font:getFace("cfont", 30)
                                })
                        })
                })
        })
})

dialog:paintTo(fb.bb, 0, 0)

fb:refresh(0)

input.waitForEvent()
--snip
2012-04-15 01:59:49 +02:00