From acd8c47a0c8bda41d1bf57a6bbc9b37b83065f6c Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 4 May 2016 21:12:08 +0200 Subject: [letterspace] fix crash in kerning by keeping the default on failed lookup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With commit 8c0dd0ebbedd kern accesses were fixed but the results never tested for the lookup, which caused the default which is set up before to be nil’ed. Fix this by reusing the value we initialized the kern factor to. --- src/luaotfload-letterspace.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/luaotfload-letterspace.lua b/src/luaotfload-letterspace.lua index 21a9136..78df1d7 100644 --- a/src/luaotfload-letterspace.lua +++ b/src/luaotfload-letterspace.lua @@ -413,7 +413,7 @@ kerncharacters = function (head) else local kern = 0 local kerns = prevchardata.kerns - if kerns then kern = kerns[lastchar] end + if kerns then kern = kerns[lastchar] or kern end krn = kern + quaddata[lastfont]*krn -- here insert_node_before(head,start,kern_injector(fillup,krn)) end @@ -488,7 +488,7 @@ kerncharacters = function (head) --- font doesn’t contain the glyph else local kerns = prevchardata.kerns - if kerns then kern = kerns[lastchar] end + if kerns then kern = kerns[lastchar] or kern end end end krn = kern + quaddata[lastfont]*krn -- here -- cgit v1.2.3