summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/math-act.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/math-act.lmt')
-rw-r--r--tex/context/base/mkxl/math-act.lmt55
1 files changed, 34 insertions, 21 deletions
diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt
index 4a46baff9..e8310ef2b 100644
--- a/tex/context/base/mkxl/math-act.lmt
+++ b/tex/context/base/mkxl/math-act.lmt
@@ -296,7 +296,7 @@ local function report_tweak(fmt,target,original,...)
metadata and metadata.fontname or "unknown",
parameters.size or 655360,
parameters.mathsize or 1,
- string.formatters[fmt](...)
+ formatters[fmt](...)
)
else
print("something is wrong")
@@ -1701,7 +1701,8 @@ do
accent = {
[0x0300] = over, -- widegrave
[0x0308] = over, -- wideddot
- [0x0304] = over, -- widebar
+ [0x0304] = over, -- macron (bar)
+ [0x0305] = over, -- widebar
[0x0301] = over, -- wideacute
[0x0302] = over, -- widehat
[0x030C] = over, -- widecheck
@@ -2116,7 +2117,7 @@ do
local force = false experiments.register("math.arrows", function(v) force = v end)
local function tighten(target,unicode,left,right,squeeze,yoffset)
- local name = string.formatters["math tightened %U %.3N %.3N %.3N %.3N"](unicode,left,right,squeeze,yoffset)
+ local name = formatters["math tightened %U %.3N %.3N %.3N %.3N"](unicode,left,right,squeeze,yoffset)
local slot = privateslot(target,name)
if not slot then
local characters = target.characters
@@ -2654,17 +2655,17 @@ do -- see pagella for an extensive example
local nps = fonts.helpers.newprivateslot
local mapping = {
- [0x0300] = { 0x0060, false, nps("flat 0x0060 1") },
- [0x0308] = { 0x00A8, false, nps("flat 0x00A8 1") },
- [0x0304] = { 0x00AF, false, nps("flat 0x00AF 1") },
- [0x0301] = { 0x00B4, false, nps("flat 0x00B4 1") },
- [0x0302] = { 0x02C6, true, nps("flat 0x02C6 1") },
- [0x030C] = { 0x02C7, true, nps("flat 0x02C7 1") },
- [0x0306] = { 0x02D8, false, nps("flat 0x02D8 1") },
- [0x0307] = { 0x02D9, false, nps("flat 0x02D9 1") },
- [0x030A] = { 0x02DA, false, nps("flat 0x02DA 1") },
- [0x0303] = { 0x02DC, true, nps("flat 0x02DC 1") },
- [0x20DB] = { 0x20DB, false, nps("flat 0x20DB 1") },
+ [0x0300] = { 0x0060, false },
+ [0x0308] = { 0x00A8, false },
+ [0x0304] = { 0x00AF, false }, -- 305
+ [0x0301] = { 0x00B4, false },
+ [0x0302] = { 0x02C6, true },
+ [0x030C] = { 0x02C7, true },
+ [0x0306] = { 0x02D8, false },
+ [0x0307] = { 0x02D9, false },
+ [0x030A] = { 0x02DA, false },
+ [0x0303] = { 0x02DC, true },
+ [0x20DB] = { 0x20DB, false },
}
datasets.fixaccents = mapping
@@ -2686,6 +2687,15 @@ do -- see pagella for an extensive example
stretchingdata.advance = 0
stretchingdata.topanchor = topanchor
stretchingdata.commands = { rightcommand[width + topanchor], charcommand[stretching] }
+-- local flat = stretchingdata.flataccent
+-- if flat then
+-- -- Nasty! xoffset needed. Check this when we patch vf.
+-- local flatdata = characters[flat]
+-- flatdata.width = width
+-- flatdata.advance = 0
+-- flatdata.topanchor = topanchor
+-- flatdata.xoffset = width + topanchor
+-- end
if not trace_tweaking then
done = true
elseif done then
@@ -2753,20 +2763,23 @@ do -- see pagella for an extensive example
-- offset factor 0.9|calculated
-- squeeze factor 0.1|calculated
+ local f_flat = formatters["flat accent %05X"]
+
function mathtweaks.flattenaccents(target,original,parameters)
local characters = target.characters
local force = parameters.force
- local squeeze = parameters.squeeze or 0.8
- local ofactor = parameters.offset or (squeeze/2)
+ local squeeze = parameters.squeeze or 0.85
+ local ofactor = parameters.offset or (squeeze/8.5)
local hfactor = parameters.height or (1 - ofactor)
local done = false
for stretching, entry in sortedhash(mapping) do
+ local code = stretching
local last = characters[stretching]
while last do
if force or not last.flataccent then
- local slot = entry[3]
+ local slot = nps(f_flat(code))
local data = copytable(last)
- local height = data.height or 0
+ local height = data.height or 0
data.effect = { squeeze = squeeze }
data.height = hfactor * height
data.yoffset = ofactor * height
@@ -2780,9 +2793,9 @@ do -- see pagella for an extensive example
done = { [stretching] = true }
end
end
- local n = last.next
- if n then
- last = characters[n]
+ code = last.next
+ if code then
+ last = characters[code]
else
break
end