diff options
Diffstat (limited to 'tex/context/modules/mkiv/s-fonts-tables.lua')
-rw-r--r-- | tex/context/modules/mkiv/s-fonts-tables.lua | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tex/context/modules/mkiv/s-fonts-tables.lua b/tex/context/modules/mkiv/s-fonts-tables.lua index c9aa7b801..65725594b 100644 --- a/tex/context/modules/mkiv/s-fonts-tables.lua +++ b/tex/context/modules/mkiv/s-fonts-tables.lua @@ -678,18 +678,28 @@ end local function collectligatures(steps) + -- Mostly the same as s-fonts-features so we should make a helper. + local series = { } local stack = { } local max = 0 + local function add(v) + local n = #stack + if n > max then + max = n + end + series[#series+1] = { v, unpack(stack) } + end + local function make(tree) for k, v in sortedhash(tree) do if k == "ligature" then - local n = #stack - if n > max then - max = n - end - series[#series+1] = { v, unpack(stack) } + add(v) + elseif tonumber(v) then + insert(stack,k) + add(v) + remove(stack) else insert(stack,k) make(v) |