summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-12-07 22:30:45 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-12-07 22:30:45 +0100
commit6ea428810db64a7acdda6776c124413ee5f6bebd (patch)
treead42ca16ceb7237a358f3b41600ed68e9bf17773 /src
parent70cc847f265fee9c2a1b74e43e1404d47d5e0a80 (diff)
downloadluaotfload-6ea428810db64a7acdda6776c124413ee5f6bebd.tar.gz
[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.
Diffstat (limited to 'src')
-rw-r--r--src/luaotfload-letterspace.lua4
1 files 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