summaryrefslogtreecommitdiff
path: root/tex/context/base/font-gds.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2009-10-27 16:35:00 +0100
committerHans Hagen <pragma@wxs.nl>2009-10-27 16:35:00 +0100
commit9da04bd6fa363277da00d82aa369e51a2e4202ae (patch)
treea51ccea0ba4b0f3af720f8d9ce2a763501bfe19b /tex/context/base/font-gds.lua
parent056c9e0d93dfc35d66ade03b1f144afc319aeaac (diff)
downloadcontext-9da04bd6fa363277da00d82aa369e51a2e4202ae.tar.gz
stable 2009.10.27 16:35
Diffstat (limited to 'tex/context/base/font-gds.lua')
-rw-r--r--tex/context/base/font-gds.lua34
1 files changed, 27 insertions, 7 deletions
diff --git a/tex/context/base/font-gds.lua b/tex/context/base/font-gds.lua
index 9a59b404e..2a6d9f8e4 100644
--- a/tex/context/base/font-gds.lua
+++ b/tex/context/base/font-gds.lua
@@ -6,7 +6,6 @@ if not modules then modules = { } end modules ['font-gds'] = {
license = "see context related readme files"
}
-local flattened= table.flattened
local type, next = type, next
local gmatch = string.gmatch
@@ -37,6 +36,10 @@ local function getgoodies(filename) -- maybe a merge is better
data[filename] = false -- signal for not found
else
goodies = dofile(fullname) or false
+ for name, fnc in next, list do
+ fnc(goodies)
+ end
+ goodies.initialized = true
data[filename] = goodies
end
end
@@ -60,12 +63,6 @@ function fonts.initializers.common.goodies(tfmdata,value)
local ok = getgoodies(filename)
if ok then
goodies[#goodies+1] = ok
- if not ok.initialized then
- for name, fnc in next, list do
- fnc(ok,tfmdata)
- end
- ok.initialized = true
- end
end
end
tfmdata.goodies = goodies -- shared ?
@@ -73,6 +70,29 @@ end
-- featuresets
+local function flattened(t,tt)
+ -- first set value dominates
+ local tt = tt or { }
+ for i=1,#t do
+ local ti = t[i]
+ if type(ti) == "table" then
+ flattened(ti,tt)
+ elseif tt[ti] == nil then
+ tt[ti] = true
+ end
+ end
+ for k, v in next, t do
+ if type(k) ~= "number" then
+ if type(v) == "table" then
+ flattened(v,tt)
+ elseif tt[k] == nil then
+ tt[k] = v
+ end
+ end
+ end
+ return tt
+end
+
local function initialize(goodies,tfmdata)
local featuresets = goodies.featuresets
local goodiesname = goodies.name