From 6ea428810db64a7acdda6776c124413ee5f6bebd Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 7 Dec 2014 22:30:45 +0100 Subject: [letterspace] add extra checks for character table fix https://github.com/lualatex/luaotfload/issues/258 This fix was proposed by /u/saidai-no on Github. --- 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 20f29f5..f1fb234 100644 --- a/src/luaotfload-letterspace.lua +++ b/src/luaotfload-letterspace.lua @@ -321,7 +321,7 @@ kerncharacters = function (head) if keeptogether and keeptogether(prev,start) then -- keep 'm elseif identifiers[lastfont] then - local kerns = chardata[lastfont][prevchar].kerns + local kerns = chardata[lastfont] and chardata[lastfont][prevchar].kerns local kern = kerns and kerns[lastchar] or 0 krn = kern + quaddata[lastfont]*krn -- here insert_node_before(head,start,kern_injector(fillup,krn)) @@ -385,7 +385,7 @@ kerncharacters = function (head) elseif identifiers[lastfont] then if prv and prv.id == glyph_code and prv.font == lastfont then local prevchar, lastchar = prv.char, start.char - local kerns = chardata[lastfont][prevchar].kerns + local kerns = chardata[lastfont] and chardata[lastfont][prevchar].kerns local kern = kerns and kerns[lastchar] or 0 krn = kern + quaddata[lastfont]*krn -- here else -- cgit v1.2.3