summaryrefslogtreecommitdiff
path: root/tex/context/base/font-ctx.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2013-03-17 13:31:00 +0100
committerHans Hagen <pragma@wxs.nl>2013-03-17 13:31:00 +0100
commit6019523a7b45211f173ea906c8407bfba69d87bf (patch)
treee6cec705f8b31d8995a2e35c779a40c3b2b2a066 /tex/context/base/font-ctx.lua
parent2bc833c2f33d4bf2eb523c4bff7eb662874e111f (diff)
downloadcontext-6019523a7b45211f173ea906c8407bfba69d87bf.tar.gz
beta 2013.03.17 13:31
Diffstat (limited to 'tex/context/base/font-ctx.lua')
-rw-r--r--tex/context/base/font-ctx.lua38
1 files changed, 20 insertions, 18 deletions
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua
index ca146b39e..ea4418fef 100644
--- a/tex/context/base/font-ctx.lua
+++ b/tex/context/base/font-ctx.lua
@@ -21,7 +21,7 @@ local sortedhash, sortedkeys, sequenced = table.sortedhash, table.sortedkeys, ta
local settings_to_hash, hash_to_string = utilities.parsers.settings_to_hash, utilities.parsers.hash_to_string
local formatcolumns = utilities.formatters.formatcolumns
-local tostring, next, type = tostring, next, type
+local tostring, next, type, rawget = tostring, next, type, rawget
local utfchar, utfbyte = utf.char, utf.byte
local round = math.round
@@ -91,23 +91,28 @@ storage.register("fonts/numbers", numbers, "fonts.specifiers.contextnumbers")
storage.register("fonts/merged", merged, "fonts.specifiers.contextmerged")
storage.register("fonts/synonyms", synonyms, "fonts.specifiers.synonyms")
--- todo: put numbers also in setups .. we only need those at runtime anyway
+-- inspect(setups)
--- if not environment.initex then
--- for i=1,#numbers do
--- setups[i] = setups[numbers[i]]
--- end
--- end
+if environment.initex then
+ setmetatableindex(setups,function(t,k)
+ return type(k) == "number" and rawget(t,numbers[k]) or nil
+ end)
+else
+ setmetatableindex(setups,function(t,k)
+ local v = type(k) == "number" and rawget(t,numbers[k])
+ if v then
+ t[k] = v
+ return v
+ end
+ end)
+end
-utilities.strings.formatters.add(string.formatters,
- "font:name",
- [["'"..file.basename(%s.properties.name).."'"]]
-)
+-- this will move elsewhere ...
-utilities.strings.formatters.add(string.formatters,
- "font:features",
- [["'"..table.sequenced(%s," ",true).."'"]]
-)
+utilities.strings.formatters.add(string.formatters,"font:name", [["'"..file.basename(%s.properties.name).."'"]])
+utilities.strings.formatters.add(string.formatters,"font:features",[["'"..table.sequenced(%s," ",true).."'"]])
+
+-- ... like font-sfm or so
constructors.resolvevirtualtoo = true -- context specific (due to resolver)
@@ -371,9 +376,6 @@ local function definecontext(name,t) -- can be shared
end
t.number = number
setups[name] = t
--- if not environment.initex then
--- setups[number] = t
--- end
return number, t
end