summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-oto.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/base/mkiv/font-oto.lua
parentd3d93bc4f0d21a259fdafee5ba1a744999474c28 (diff)
downloadcontext-af60125ab3fa9e482720f0f46c2143fa08512113.tar.gz
2021-08-19 19:43:00
Diffstat (limited to 'tex/context/base/mkiv/font-oto.lua')
-rw-r--r--tex/context/base/mkiv/font-oto.lua72
1 files changed, 42 insertions, 30 deletions
diff --git a/tex/context/base/mkiv/font-oto.lua b/tex/context/base/mkiv/font-oto.lua
index 6f5f2fb41..0f667bcc2 100644
--- a/tex/context/base/mkiv/font-oto.lua
+++ b/tex/context/base/mkiv/font-oto.lua
@@ -170,7 +170,7 @@ end
local function makefake(tfmdata,name,present)
local private = getprivate(tfmdata)
local character = { intermediate = true, ligatures = { } }
- resources.unicodes[name] = private
+ tfmdata.resources.unicodes[name] = private
tfmdata.characters[private] = character
tfmdata.descriptions[private] = { name = name }
present[name] = private
@@ -178,43 +178,55 @@ local function makefake(tfmdata,name,present)
end
local function make_1(present,tree,name)
- for k, v in next, tree do
- if k == "ligature" then
- present[name] = v
+ if tonumber(tree) then
+ present[name] = v
+ else
+ for k, v in next, tree do
+ if k == "ligature" then
+ present[name] = v
+ else
+ make_1(present,v,name .. "_" .. k)
+ end
+ end
+ end
+end
+
+local function make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,v)
+ local character = characters[preceding]
+ if not character then
+ if trace_baseinit then
+ report_prepare("weird ligature in lookup %a, current %C, preceding %C",sequence.name,v,preceding)
+ end
+ character = makefake(tfmdata,name,present)
+ end
+ local ligatures = character.ligatures
+ if ligatures then
+ ligatures[unicode] = { char = v }
+ else
+ character.ligatures = { [unicode] = { char = v } }
+ end
+ if done then
+ local d = done[name]
+ if not d then
+ done[name] = { "dummy", v }
else
- make_1(present,v,name .. "_" .. k)
+ d[#d+1] = v
end
end
end
local function make_2(present,tfmdata,characters,tree,name,preceding,unicode,done)
- for k, v in next, tree do
- if k == "ligature" then
- local character = characters[preceding]
- if not character then
- if trace_baseinit then
- report_prepare("weird ligature in lookup %a, current %C, preceding %C",sequence.name,v,preceding)
- end
- character = makefake(tfmdata,name,present)
- end
- local ligatures = character.ligatures
- if ligatures then
- ligatures[unicode] = { char = v }
+ if tonumber(tree) then
+ make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,tree)
+ else
+ for k, v in next, tree do
+ if k == "ligature" then
+ make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,v)
else
- character.ligatures = { [unicode] = { char = v } }
+ local code = present[name] or unicode
+ local name = name .. "_" .. k
+ make_2(present,tfmdata,characters,v,name,code,k,done)
end
- if done then
- local d = done[name]
- if not d then
- done[name] = { "dummy", v }
- else
- d[#d+1] = v
- end
- end
- else
- local code = present[name] or unicode
- local name = name .. "_" .. k
- make_2(present,tfmdata,characters,v,name,code,k,done)
end
end
end