summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-05-04 21:12:08 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-05-04 21:12:11 +0200
commitacd8c47a0c8bda41d1bf57a6bbc9b37b83065f6c (patch)
tree99bb745a016dac105c5e7ab8bf44737f3123ba7d /src
parent766978d24919fef28e12a8c4239c96e92dc349a5 (diff)
downloadluaotfload-acd8c47a0c8bda41d1bf57a6bbc9b37b83065f6c.tar.gz
[letterspace] fix crash in kerning by keeping the default on failed lookup
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.
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 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