summaryrefslogtreecommitdiff
path: root/tex/context/base/char-ini.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/char-ini.lua')
-rw-r--r--tex/context/base/char-ini.lua31
1 files changed, 20 insertions, 11 deletions
diff --git a/tex/context/base/char-ini.lua b/tex/context/base/char-ini.lua
index 244b8d2a7..90e36bc7b 100644
--- a/tex/context/base/char-ini.lua
+++ b/tex/context/base/char-ini.lua
@@ -455,28 +455,37 @@ table we derive a few more.</p>
if not characters.fallbacks then
- -- we could the definition by using a metatable
+ characters.fallbacks = { } -- not than many
- characters.fallbacks = { }
- characters.directions = { }
+ local fallbacks = characters.fallbacks
- local fallbacks = characters.fallbacks
- local directions = characters.directions
-
- for k,v in next, data do
- local specials = v.specials
+ for k, d in next, data do
+ local specials = d.specials
if specials and specials[1] == "compat" and specials[2] == 0x0020 and specials[3] then
local s = specials[3]
fallbacks[k] = s
fallbacks[s] = k
end
- directions[k] = v.direction
end
end
-storage.register("characters/fallbacks", characters.fallbacks, "characters.fallbacks") -- accents and such
-storage.register("characters/directions", characters.directions, "characters.directions")
+storage.register("characters/fallbacks", characters.fallbacks, "characters.fallbacks") -- accents and such
+
+characters.directions = { }
+
+setmetatableindex(characters.directions,function(t,k)
+ local d = data[k]
+ if d then
+ local v = d.direction
+ if v then
+ t[k] = v
+ return v
+ end
+ end
+ t[k] = false -- maybe 'l'
+ return v
+end)
--[[ldx--
<p>The <type>context</type> namespace is used to store methods and data