Fix the kerning check in renderUtf8TextWidth()

This is a completion of my fixes that went into PR \#383.
In the function renderUtf8TextWidth() the check for kerning was
meaningless (always true).
Tigran Aivazian 12 years ago
parent 36486d0697
commit cb25029ddd

@ -123,7 +123,7 @@ function renderUtf8TextWidth(buffer, x, y, face, text, kerning, w)
if pen_x < w then
local charcode = util.utf8charcode(uchar)
local glyph = getGlyph(face, charcode)
if kerning and prevcharcode then
if kerning and (prevcharcode ~= 0) then
pen_x = pen_x + face.ftface:getKerning(prevcharcode, charcode)
end
buffer:addblitFrom(glyph.bb, x + pen_x + glyph.l, y - glyph.t, 0, 0, glyph.bb:getWidth(), glyph.bb:getHeight())

Loading…
Cancel
Save