summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-con.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-06-06 20:26:50 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-06-06 20:26:50 +0200
commitd78828b55508aae49922032ebd9117804a940f73 (patch)
tree431d8c001f14d8001ba11c6e2803ef83ba65c9fe /tex/context/base/mkiv/font-con.lua
parent7a761c8aebf67ee022aa4857247518ad6997d5c1 (diff)
downloadcontext-d78828b55508aae49922032ebd9117804a940f73.tar.gz
2016-06-06 19:57:00
Diffstat (limited to 'tex/context/base/mkiv/font-con.lua')
-rw-r--r--tex/context/base/mkiv/font-con.lua22
1 files changed, 20 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/font-con.lua b/tex/context/base/mkiv/font-con.lua
index 3af286203..1a0daff63 100644
--- a/tex/context/base/mkiv/font-con.lua
+++ b/tex/context/base/mkiv/font-con.lua
@@ -1255,7 +1255,11 @@ function constructors.getfeatureaction(what,where,mode,name)
end
end
-function constructors.newhandler(what) -- could be a metatable newindex
+local newhandler = { }
+constructors.handlers = newhandler -- downward compatible
+constructors.newhandler = newhandler
+
+local function setnewhandler(what) -- could be a metatable newindex
local handler = handlers[what]
if not handler then
handler = { }
@@ -1264,7 +1268,16 @@ function constructors.newhandler(what) -- could be a metatable newindex
return handler
end
-function constructors.newfeatures(what) -- could be a metatable newindex
+setmetatable(newhandler, {
+ __call = function(t,k) local v = t[k] return v end,
+ __index = function(t,k) local v = setnewhandler(k) t[k] = v return v end,
+})
+
+local newfeatures = { }
+constructors.newfeatures = newfeatures -- downward compatible
+constructors.features = newfeatures
+
+local function setnewfeatures(what)
local handler = handlers[what]
local features = handler.features
if not features then
@@ -1284,6 +1297,11 @@ function constructors.newfeatures(what) -- could be a metatable newindex
return features
end
+setmetatable(newfeatures, {
+ __call = function(t,k) local v = t[k] return v end,
+ __index = function(t,k) local v = setnewfeatures(k) t[k] = v return v end,
+})
+
--[[ldx--
<p>We need to check for default features. For this we provide
a helper function.</p>