use font metric to better display help page (to exted to other pages in future)

This commit is contained in:
traycold
2012-03-20 23:28:49 +01:00
parent 81f99e4921
commit ce30d9c652
4 changed files with 25 additions and 22 deletions

View File

@@ -88,10 +88,10 @@ function renderUtf8Text(buffer, x, y, face, facehash, text, kerning)
if kerning and prevcharcode then
local kern = face:getKerning(prevcharcode, charcode)
pen_x = pen_x + kern
--print("prev:"..prevcharcode.." curr:"..charcode.." kern:"..kern)
--print("prev:"..string.char(prevcharcode).." curr:"..string.char(charcode).." pen_x:"..pen_x.." kern:"..kern)
buffer:addblitFrom(glyph.bb, x + pen_x + glyph.l, y - glyph.t, 0, 0, glyph.bb:getWidth(), glyph.bb:getHeight())
else
--print(" curr:"..charcode)
--print(" curr:"..string.char(charcode))
buffer:blitFrom(glyph.bb, x + pen_x + glyph.l, y - glyph.t, 0, 0, glyph.bb:getWidth(), glyph.bb:getHeight())
end
pen_x = pen_x + glyph.ax