summaryrefslogtreecommitdiff
path: root/tex/context/base/math-map.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/math-map.lua')
-rw-r--r--tex/context/base/math-map.lua22
1 files changed, 20 insertions, 2 deletions
diff --git a/tex/context/base/math-map.lua b/tex/context/base/math-map.lua
index 17841bde6..47c6c88e2 100644
--- a/tex/context/base/math-map.lua
+++ b/tex/context/base/math-map.lua
@@ -37,7 +37,7 @@ local mathematics = mathematics
-- following approach permits easier remapping of a-a, A-Z and 0-9 to
-- fallbacks; symbols is currently mostly greek
-mathematics.alphabets = allocate {
+local alphabets = allocate {
regular = {
tf = {
digits = 0x00030,
@@ -272,7 +272,8 @@ mathematics.alphabets = allocate {
},
}
-local alphabets = mathematics.alphabets
+mathematics.alphabets = alphabets
+
local mathremap = { }
for alphabet, styles in next, alphabets do
@@ -443,3 +444,20 @@ function mathematics.remapalphabets(char,mathalphabet,mathgreek)
end
return nil
end
+
+local function checkedcopy(characters,child,parent)
+ for k, v in next, child do
+ if not characters[v] then
+ characters[v] = characters[parent[k]]
+ end
+ end
+end
+
+function mathematics.addfallbacks(main)
+ local characters = main.characters
+ local regular = alphabets.regular
+ checkedcopy(characters,regular.bf.ucgreek,regular.tf.ucgreek)
+ checkedcopy(characters,regular.bf.lcgreek,regular.tf.lcgreek)
+ checkedcopy(characters,regular.bi.ucgreek,regular.it.ucgreek)
+ checkedcopy(characters,regular.bi.lcgreek,regular.it.lcgreek)
+end