From cb25029dddc42693cc7aaefbe47e9bd3b7e1a750 Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Sun, 7 Oct 2012 16:00:41 +0100 Subject: [PATCH] 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). --- rendertext.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rendertext.lua b/rendertext.lua index 286389ce9..753055a91 100644 --- a/rendertext.lua +++ b/rendertext.lua @@ -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())