summaryrefslogtreecommitdiff
path: root/tex/context/base/math-act.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/math-act.lua')
-rw-r--r--tex/context/base/math-act.lua81
1 files changed, 60 insertions, 21 deletions
diff --git a/tex/context/base/math-act.lua b/tex/context/base/math-act.lua
index fc63a0090..879480dce 100644
--- a/tex/context/base/math-act.lua
+++ b/tex/context/base/math-act.lua
@@ -601,6 +601,47 @@ blocks["digitsextendedarabicindic"] = { first = 0x006F0, last = 0x006F
-- symbolsb : 0x02901
-- supplemental : 0x02A00
+-- from mathematics.gaps:
+
+blocks["lowercaseitalic"].gaps = {
+ [0x1D455] = 0x0210E, -- ℎ h
+}
+
+blocks["uppercasescript"].gaps = {
+ [0x1D49D] = 0x0212C, -- ℬ script B
+ [0x1D4A0] = 0x02130, -- ℰ script E
+ [0x1D4A1] = 0x02131, -- ℱ script F
+ [0x1D4A3] = 0x0210B, -- ℋ script H
+ [0x1D4A4] = 0x02110, -- ℐ script I
+ [0x1D4A7] = 0x02112, -- ℒ script L
+ [0x1D4A8] = 0x02133, -- ℳ script M
+ [0x1D4AD] = 0x0211B, -- ℛ script R
+}
+
+blocks["lowercasescript"].gaps = {
+ [0x1D4BA] = 0x0212F, -- ℯ script e
+ [0x1D4BC] = 0x0210A, -- ℊ script g
+ [0x1D4C4] = 0x02134, -- ℴ script o
+}
+
+blocks["uppercasefraktur"].gaps = {
+ [0x1D506] = 0x0212D, -- ℭ fraktur C
+ [0x1D50B] = 0x0210C, -- ℌ fraktur H
+ [0x1D50C] = 0x02111, -- ℑ fraktur I
+ [0x1D515] = 0x0211C, -- ℜ fraktur R
+ [0x1D51D] = 0x02128, -- ℨ fraktur Z
+}
+
+blocks["uppercasedoublestruck"].gaps = {
+ [0x1D53A] = 0x02102, -- ℂ bb C
+ [0x1D53F] = 0x0210D, -- ℍ bb H
+ [0x1D545] = 0x02115, -- ℕ bb N
+ [0x1D547] = 0x02119, -- ℙ bb P
+ [0x1D548] = 0x0211A, -- ℚ bb Q
+ [0x1D549] = 0x0211D, -- ℝ bb R
+ [0x1D551] = 0x02124, -- ℤ bb Z
+}
+
-- todo: tounicode
function mathematics.injectfallbacks(target,original)
@@ -635,6 +676,7 @@ function mathematics.injectfallbacks(target,original)
local name = definition.font
local start = definition.start
local stop = definition.stop
+ local gaps = definition.gaps
local check = definition.check
local force = definition.force
local rscale = definition.rscale or 1
@@ -643,29 +685,26 @@ function mathematics.injectfallbacks(target,original)
local index = #fonts + 1
fonts[index] = { id = id, size = size }
local chars = fontchars[id]
- if check then
- for unicode = start, stop do
- local unic = unicode + offset - start
- if not chars[unicode] then
- -- not in font
- elseif force or (not done[unic] and not characters[unic]) then
- if trace_collecting then
- report_math("remapping math character, vector %a, font %a, character %C, %s",fallbacks,name,unic,"checked")
- end
- characters[unic] = copiedglyph(target,characters,chars,unicode,index)
- done[unic] = true
+ local function remap(unic,unicode,gap)
+ local unic = unicode + offset - start
+ if check and not chars[unicode] then
+ -- not in font
+ elseif force or (not done[unic] and not characters[unic]) then
+ if trace_collecting then
+ report_math("remapping math character, vector %a, font %a, character %C%s%s",
+ fallbacks,name,unic,check and ", checked",gap and ", gap plugged")
end
+ characters[unic] = copiedglyph(target,characters,chars,unicode,index)
+ done[unic] = true
end
- else
- for unicode = start, stop do
- local unic = unicode + offset - start
- if force or (not done[unic] and not characters[unic]) then
- if trace_collecting then
- report_math("remapping math character, vector %a, font %a, character %C, %s",fallbacks,name,unic,"unchecked")
- end
- characters[unic] = copiedglyph(target,characters,chars,unicode,index)
- done[unic] = true
- end
+ end
+ for unicode = start, stop do
+ local unic = unicode + offset - start
+ remap(unic,unicode,false)
+ end
+ if gaps then
+ for unic, unicode in next, gaps do
+ remap(unic,unicode,true)
end
end
end