Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
[letterspace] fix crash in kerning by keeping the default on failed l…
Browse files Browse the repository at this point in the history
…ookup

With commit 8c0dd0e 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.
  • Loading branch information
phi-gamma committed May 4, 2016
1 parent 766978d commit acd8c47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/luaotfload-letterspace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit acd8c47

Please sign in to comment.