summaryrefslogtreecommitdiff
path: root/tex/context/base/font-otd.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2014-03-22 15:31:00 +0100
committerHans Hagen <pragma@wxs.nl>2014-03-22 15:31:00 +0100
commitc70b2e466bbb07e976f8684d56ae4e5398169e7d (patch)
treed644f87f32feeddcfb2de6e8ebe6667423eb0be4 /tex/context/base/font-otd.lua
parent244a447d70f406e1341a56016564518013496a32 (diff)
downloadcontext-c70b2e466bbb07e976f8684d56ae4e5398169e7d.tar.gz
beta 2014.03.22 15:31
Diffstat (limited to 'tex/context/base/font-otd.lua')
-rw-r--r--tex/context/base/font-otd.lua26
1 files changed, 17 insertions, 9 deletions
diff --git a/tex/context/base/font-otd.lua b/tex/context/base/font-otd.lua
index 919da2379..e421111dd 100644
--- a/tex/context/base/font-otd.lua
+++ b/tex/context/base/font-otd.lua
@@ -129,10 +129,13 @@ local default = "dflt"
-- what about analyze in local and not in font
-local function initialize(sequence,script,language,s_enabled,a_enabled,font,attr,dynamic)
+local function initialize(sequence,script,language,s_enabled,a_enabled,font,attr,dynamic,ra)
local features = sequence.features
if features then
- for kind, scripts in next, features do
+ local order = sequence.order or { }
+ -- for kind, scripts in next, features do
+ for i=1,#order do --
+ local kind = order[i] --
local e_e
local a_e = a_enabled and a_enabled[kind] -- the value (location)
if a_e ~= nil then
@@ -141,6 +144,7 @@ local function initialize(sequence,script,language,s_enabled,a_enabled,font,attr
e_e = s_enabled and s_enabled[kind] -- the value (font)
end
if e_e then
+ local scripts = features[kind] --
local languages = scripts[script] or scripts[wildcard]
if languages then
-- local valid, what = false
@@ -174,14 +178,14 @@ local function initialize(sequence,script,language,s_enabled,a_enabled,font,attr
"font %s, dynamic %a (%a), feature %a, script %a, language %a, lookup %a, value %a",
font,attr or 0,dynamic,kind,script,language,sequence.name,valid)
end
- return { valid, attribute, sequence.chain or 0, kind, sequence }
+ ra[#ra+1] = { valid, attribute, sequence.chain or 0, kind, sequence }
end
end
end
end
- return false -- { valid, attribute, chain, "generic", sequence } -- false anyway, could be flag instead of table
+ -- { valid, attribute, chain, "generic", sequence } -- false anyway, could be flag instead of table
else
- return false -- { false, false, chain, false, sequence } -- indirect lookup, part of chain (todo: make this a separate table)
+ -- { false, false, chain, false, sequence } -- indirect lookup, part of chain (todo: make this a separate table)
end
end
@@ -249,12 +253,16 @@ function otf.dataset(tfmdata,font,attr) -- attr only when explicit (as in specia
-- return v
-- end
-- end)
+-- for s=1,#sequences do
+-- local v = initialize(sequences[s],script,language,s_enabled,a_enabled,font,attr,dynamic)
+-- if v then
+-- ra[#ra+1] = v
+-- end
+-- end
for s=1,#sequences do
- local v = initialize(sequences[s],script,language,s_enabled,a_enabled,font,attr,dynamic)
- if v then
- ra[#ra+1] = v
- end
+ initialize(sequences[s],script,language,s_enabled,a_enabled,font,attr,dynamic,ra)
end
+-- table.save((jit and "tmc-" or "tma-")..font..".log",ra) -- bug in jit
end
return ra