Skip to content

Commit

Permalink
Fix multiple discretionaries at start of run
Browse files Browse the repository at this point in the history
  • Loading branch information
zauguin committed Mar 10, 2021
1 parent 5b924e5 commit 04613e2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/luaotfload-harf-plug.lua
Expand Up @@ -181,7 +181,8 @@ local function itemize(head, fontid, direction)
local dirstack = {}
local currdir = direction or 0
local lastskip, lastdir = true
local lastrun = {}
local dummyrun = { start = 0, len = 0 }
local lastrun = dummyrun
local lastdisc
local in_disc

Expand Down Expand Up @@ -226,9 +227,6 @@ local function itemize(head, fontid, direction)
setlink(prev, n)
code = nil
skip = false
if not prev then
head = n
end
else
skip = true
end
Expand Down Expand Up @@ -272,6 +270,9 @@ local function itemize(head, fontid, direction)
lastrun.len = lastrun.len + 1
elseif disc then
if lastdisc then
if lastrun.len == 0 then
runs[#runs - 1].after = n
end
lastdisc.next = disc
lastdisc = disc
else
Expand All @@ -280,7 +281,7 @@ local function itemize(head, fontid, direction)
end
end

return head, runs
return dummyrun.after, runs
end


Expand Down

0 comments on commit 04613e2

Please sign in to comment.