summaryrefslogtreecommitdiff
path: root/tex/context/base/font-otn.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-05-23 10:30:00 +0200
committerHans Hagen <pragma@wxs.nl>2012-05-23 10:30:00 +0200
commit30c3294301573aec0afef18904554e1365726724 (patch)
tree7f4c7bf16fb81fb85699fbedb8731a1b1cc27fcc /tex/context/base/font-otn.lua
parent916b776c4ffdc051e4af42ca35d7ba8337d84667 (diff)
downloadcontext-30c3294301573aec0afef18904554e1365726724.tar.gz
beta 2012.05.23 10:30
Diffstat (limited to 'tex/context/base/font-otn.lua')
-rw-r--r--tex/context/base/font-otn.lua166
1 files changed, 0 insertions, 166 deletions
diff --git a/tex/context/base/font-otn.lua b/tex/context/base/font-otn.lua
index 8e6759747..7a5708583 100644
--- a/tex/context/base/font-otn.lua
+++ b/tex/context/base/font-otn.lua
@@ -2426,172 +2426,6 @@ local function split(replacement,original)
return result
end
--- not shared as we hook into lookups now
-
---~ local function uncover_1(covers,result) -- multiple covers
---~ local nofresults = #result
---~ for n=1,#covers do
---~ nofresults = nofresults + 1
---~ local u = { }
---~ local c = covers[n]
---~ for i=1,#c do
---~ u[c[i]] = true
---~ end
---~ result[nofresults] = u
---~ end
---~ end
-
---~ local function uncover_2(covers,result) -- single covers (turned into multiple with n=1)
---~ local nofresults = #result
---~ for n=1,#covers do
---~ nofresults = nofresults + 1
---~ result[nofresults] = { [covers[n]] = true }
---~ end
---~ end
-
---~ local function uncover_1(covers,result) -- multiple covers
---~ local nofresults = #result
---~ for n=1,#covers do
---~ nofresults = nofresults + 1
---~ result[nofresults] = covers[n]
---~ end
---~ end
-
---~ local function prepare_contextchains(tfmdata)
---~ local rawdata = tfmdata.shared.rawdata
---~ local resources = rawdata.resources
---~ local lookuphash = resources.lookuphash
---~ local lookups = rawdata.lookups
---~ if lookups then
---~ for lookupname, lookupdata in next, rawdata.lookups do
---~ local lookuptype = lookupdata.type
---~ if not lookuptype then
---~ report_prepare("missing lookuptype for %s",lookupname)
---~ else -- => lookuphash[lookupname][unicode]
---~ local rules = lookupdata.rules
---~ if rules then
---~ local fmt = lookupdata.format
---~ -- if fmt == "coverage" then
---~ if fmt == "coverage" or fmt == "glyphs" then
---~ if lookuptype ~= "chainsub" and lookuptype ~= "chainpos" then
---~ -- todo: dejavu-serif has one (but i need to see what use it has)
---~ report_prepare("unsupported coverage %s for %s",lookuptype,lookupname)
---~ else
---~ local contexts = lookuphash[lookupname]
---~ if not contexts then
---~ contexts = { }
---~ lookuphash[lookupname] = contexts
---~ end
---~ local t, nt = { }, 0
---~ for nofrules=1,#rules do -- does #rules>1 happen often?
---~ local rule = rules[nofrules]
---~ local current = rule.current
---~ local before = rule.before
---~ local after = rule.after
---~ local sequence = { }
---~ if before then
---~ uncover_1(before,sequence)
---~ end
---~ local start = #sequence + 1
---~ uncover_1(current,sequence)
---~ local stop = #sequence
---~ if after then
---~ uncover_1(after,sequence)
---~ end
---~ if sequence[1] then
---~ nt = nt + 1
---~ t[nt] = { nofrules, lookuptype, sequence, start, stop, rule.lookups }
---~ for unic, _ in next, sequence[start] do
---~ local cu = contexts[unic]
---~ if not cu then
---~ contexts[unic] = t
---~ end
---~ end
---~ end
---~ end
---~ end
---~ elseif fmt == "reversecoverage" then -- we could combine both branches (only dufference is replacements)
---~ if lookuptype ~= "reversesub" then
---~ report_prepare("unsupported reverse coverage %s for %s",lookuptype,lookupname)
---~ else
---~ local contexts = lookuphash[lookupname]
---~ if not contexts then
---~ contexts = { }
---~ lookuphash[lookupname] = contexts
---~ end
---~ local t, nt = { }, 0
---~ for nofrules=1,#rules do
---~ local rule = rules[nofrules]
---~ local current = rule.current
---~ local before = rule.before
---~ local after = rule.after
---~ local replacements = rule.replacements
---~ local sequence = { }
---~ if before then
---~ uncover_1(before,sequence)
---~ end
---~ local start = #sequence + 1
---~ uncover_1(current,sequence)
---~ local stop = #sequence
---~ if after then
---~ uncover_1(after,sequence)
---~ end
---~ if sequence[1] then
---~ nt = nt + 1
---~ t[nt] = { nofrules, lookuptype, sequence, start, stop, rule.lookups, replacements }
---~ for unic, _ in next, sequence[start] do
---~ local cu = contexts[unic]
---~ if not cu then
---~ contexts[unic] = t
---~ end
---~ end
---~ end
---~ end
---~ end
---~ -- elseif fmt == "glyphs" then --maybe just make then before = { fore } and share with coverage
---~ -- if lookuptype ~= "chainsub" and lookuptype ~= "chainpos" then
---~ -- report_prepare("unsupported coverage %s for %s",lookuptype,lookupname)
---~ -- else
---~ -- local contexts = lookuphash[lookupname]
---~ -- if not contexts then
---~ -- contexts = { }
---~ -- lookuphash[lookupname] = contexts
---~ -- end
---~ -- local t, nt = { }, 0
---~ -- for nofrules=1,#rules do -- we can make glyphs a special case (less tables)
---~ -- local rule = rules[nofrules]
---~ -- local current = rule.names
---~ -- local before = rule.fore
---~ -- local after = rule.back
---~ -- local sequence = { }
---~ -- if before then
---~ -- uncover_1(before,sequence)
---~ -- end
---~ -- local start = #sequence + 1
---~ -- uncover_1(current,sequence)
---~ -- local stop = #sequence
---~ -- if after then
---~ -- uncover_1(after,sequence)
---~ -- end
---~ -- if sequence then
---~ -- nt = nt + 1
---~ -- t[nt] = { nofrules, lookuptype, sequence, start, stop, rule.lookups }
---~ -- for unic, _ in next, sequence[start] do
---~ -- local cu = contexts[unic]
---~ -- if not cu then
---~ -- contexts[unic] = t
---~ -- end
---~ -- end
---~ -- end
---~ -- end
---~ -- end
---~ end
---~ end
---~ end
---~ end
---~ end
---~ end
-
local valid = {
coverage = { chainsub = true, chainpos = true, contextsub = true },
reversecoverage = { reversesub = true },