summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/s-fonts-tables.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-08-19 20:32:31 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-08-19 20:32:31 +0200
commitaf60125ab3fa9e482720f0f46c2143fa08512113 (patch)
tree3e85c8a8a5979ebd05b891f8ecfb93d1b69ac41b /tex/context/modules/mkiv/s-fonts-tables.lua
parentd3d93bc4f0d21a259fdafee5ba1a744999474c28 (diff)
downloadcontext-af60125ab3fa9e482720f0f46c2143fa08512113.tar.gz
2021-08-19 19:43:00
Diffstat (limited to 'tex/context/modules/mkiv/s-fonts-tables.lua')
-rw-r--r--tex/context/modules/mkiv/s-fonts-tables.lua20
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)