summaryrefslogtreecommitdiff
path: root/tex/context/base/math-fbk.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/math-fbk.lua')
-rw-r--r--tex/context/base/math-fbk.lua59
1 files changed, 55 insertions, 4 deletions
diff --git a/tex/context/base/math-fbk.lua b/tex/context/base/math-fbk.lua
index 68cab22d3..ce31a9982 100644
--- a/tex/context/base/math-fbk.lua
+++ b/tex/context/base/math-fbk.lua
@@ -28,6 +28,11 @@ local lastmathids = fonts.hashes.lastmathids
--
-- todo: use index 'true when luatex provides that feature (on the agenda)
+-- to be considered:
+--
+-- in luatex provide reserve_id (and pass id as field of tfmdata)
+-- in context define three sizes but pass them later i.e. do virtualize afterwards
+
function fallbacks.apply(target,original)
local mathparameters = target.mathparameters -- why not hasmath
if mathparameters then
@@ -70,7 +75,8 @@ function fallbacks.apply(target,original)
if textid then
textindex = #usedfonts + 1
usedfonts[textindex] = { id = textid }
- textdata = identifiers[textid]
+-- textdata = identifiers[textid] or target
+ textdata = target
else
textdata = target
end
@@ -98,6 +104,9 @@ function fallbacks.apply(target,original)
textindex = textindex,
scriptindex = scriptindex,
scriptscriptindex = scriptscriptindex,
+ textid = textid,
+ scriptid = scriptid,
+ scriptscriptid = scriptscriptid,
characters = characters,
unicode = k,
target = target,
@@ -105,16 +114,23 @@ function fallbacks.apply(target,original)
size = size,
mathsize = mathsize,
}
+ target.mathrelation = data
-- inspect(usedfonts)
for k, v in next, virtualcharacters do
if not characters[k] then
local tv = type(v)
+ local cd = nil
if tv == "table" then
- characters[k] = v
+ cd = v
elseif tv == "number" then
- characters[k] = characters[v]
+ cd = characters[v]
elseif tv == "function" then
- characters[k] = v(data)
+ cd = v(data)
+ end
+ if cd then
+ characters[k] = cd
+ else
+ -- something else
end
if trace_fallbacks then
if characters[k] then
@@ -123,6 +139,7 @@ function fallbacks.apply(target,original)
end
end
end
+ data.unicode = nil
end
end
@@ -446,3 +463,37 @@ end
virtualcharacters[0xFE302] = function(data) return smashed(data,0x0302,0xFE302) end
virtualcharacters[0xFE303] = function(data) return smashed(data,0x0303,0xFE303) end
+
+-- another crazy hack .. doesn't work as we define scrscr first .. we now have smaller
+-- primes so we have smaller primes for the moment, big ones will become an option
+
+local function smashed(data,unicode)
+ local oldchar = data.characters[unicode]
+ local height = 1.2 * data.target.parameters.xheight
+ local newchar = {
+ commands = {
+ { "down", oldchar.height - height },
+ { "char", unicode },
+ },
+ height = height,
+ width = oldchar.width,
+ }
+ return newchar
+end
+
+addextra(0xFE932, { description="SMASHED PRIME 0x02032", unicodeslot=0xFE932 } )
+addextra(0xFE933, { description="SMASHED PRIME 0x02033", unicodeslot=0xFE933 } )
+addextra(0xFE934, { description="SMASHED PRIME 0x02034", unicodeslot=0xFE934 } )
+addextra(0xFE935, { description="SMASHED PRIME 0x02035", unicodeslot=0xFE935 } )
+addextra(0xFE936, { description="SMASHED PRIME 0x02036", unicodeslot=0xFE936 } )
+addextra(0xFE937, { description="SMASHED PRIME 0x02037", unicodeslot=0xFE937 } )
+addextra(0xFE957, { description="SMASHED PRIME 0x02057", unicodeslot=0xFE957 } )
+
+virtualcharacters[0xFE932] = function(data) return smashed(data,0x02032) end
+virtualcharacters[0xFE933] = function(data) return smashed(data,0x02033) end
+virtualcharacters[0xFE934] = function(data) return smashed(data,0x02034) end
+virtualcharacters[0xFE935] = function(data) return smashed(data,0x02035) end
+virtualcharacters[0xFE936] = function(data) return smashed(data,0x02036) end
+virtualcharacters[0xFE937] = function(data) return smashed(data,0x02037) end
+virtualcharacters[0xFE957] = function(data) return smashed(data,0x02057) end
+