From 657457ef4a08c1f000f272e00f654f4064cc37bd Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sat, 15 Apr 2023 01:06:07 +0200 Subject: 2023-04-15 00:22:00 --- tex/context/fonts/mkiv/bonum-math.lfg | 3 + tex/context/fonts/mkiv/common-math-jmn.lfg | 104 +++++++++++++++++++--- tex/context/fonts/mkiv/concrete-math.lfg | 3 + tex/context/fonts/mkiv/dejavu-math.lfg | 3 + tex/context/fonts/mkiv/ebgaramond-math.lfg | 3 + tex/context/fonts/mkiv/erewhon-math.lfg | 3 + tex/context/fonts/mkiv/kpfonts-math.lfg | 3 + tex/context/fonts/mkiv/modern-math.lfg | 3 + tex/context/fonts/mkiv/newcomputermodern-math.lfg | 3 + tex/context/fonts/mkiv/pagella-math.lfg | 3 + tex/context/fonts/mkiv/schola-math.lfg | 3 + tex/context/fonts/mkiv/stixtwo-math.lfg | 13 +++ tex/context/fonts/mkiv/termes-math.lfg | 3 + tex/context/fonts/mkiv/xcharter-math.lfg | 3 + 14 files changed, 141 insertions(+), 12 deletions(-) (limited to 'tex/context/fonts') diff --git a/tex/context/fonts/mkiv/bonum-math.lfg b/tex/context/fonts/mkiv/bonum-math.lfg index 2852c6449..ce36da352 100644 --- a/tex/context/fonts/mkiv/bonum-math.lfg +++ b/tex/context/fonts/mkiv/bonum-math.lfg @@ -70,6 +70,9 @@ return { presets.moveitalics { correct = true }, presets.wipeanchors { }, presets.wipeitalics { }, + { + tweak = "checkaccents", + }, { -- We need to check these, are the tweaks necessary or not? tweak = "dimensions", diff --git a/tex/context/fonts/mkiv/common-math-jmn.lfg b/tex/context/fonts/mkiv/common-math-jmn.lfg index 1ebb7db39..995da0db6 100644 --- a/tex/context/fonts/mkiv/common-math-jmn.lfg +++ b/tex/context/fonts/mkiv/common-math-jmn.lfg @@ -1,3 +1,15 @@ +local nps = fonts.helpers.newprivateslot + +local fake20D6 = nps("arrow fake 0x20D6") +local fake20D7 = nps("arrow fake 0x20D7") +local fake20E1 = nps("arrow fake 0x20E1") + +local fake20EE = nps("arrow fake 0x20EE") +local fake20EF = nps("arrow fake 0x20EF") +local fake034D = nps("arrow fake 0x034D") + +local real034D = nps("arrow real 0x034D") + return { name = "common-math-jmn", version = "1.00", @@ -118,7 +130,7 @@ return { builders.horibar(main,0x203E,false,false,false,0x02212) end - local ffactor = antykwa and 1 or 1 + local ffactor = antykwa and 1 or 1 -- check MS local mfactor = antykwa and 1 or .8 local lfactor = antykwa and 1 or .8 @@ -131,8 +143,11 @@ return { builders.extension(main,0x27F9,dfl,dfm,dar,ffactor,mfactor,lfactor) builders.extension(main,0x27FA,dal,dfm,dar,ffactor,mfactor,lfactor) - local tfactor = antykwa and -0.8 or -0.8 - local bfactor = antykwa and 0.1 or 0.1 + local tfactor = antykwa and -0.8 or -1.1 -- move up check MS + local bfactor = antykwa and 0.1 or 0.2 + +local tfactor = antykwa and -0.6 or -.6 -- move up check MS +local bfactor = antykwa and 0.1 or 0.2 local left = characters[0x27F5] local right = characters[0x27F6] @@ -141,17 +156,82 @@ return { local height = max(left.height or 0,right.height or 0,both.height or 0) local depth = max(left.depth or 0,right.depth or 0,both.depth or 0) - left .height = height left .depth = depth - right.height = height right.depth = depth - both .height = height both .depth = depth + left .height = height ; left .depth = depth + right.height = height ; right.depth = depth + both .height = height ; both .depth = depth + + -- top and bottom arrows : a real mess but now we're drawn into patching it; why are these + -- small ones shifted in the bbox; we could do a better job on top and bottom anchors; we + -- also could use the bbox as in opentype (\wideoverleftarrow etc) + + local rightarrow = characters[0x20D7] + local leftarrow = copytable(rightarrow) + local doublearrow = copytable(rightarrow) + local width = rightarrow.width + local height = rightarrow.height + + -- top + + characters[0x20D6] = leftarrow + characters[0x20E1] = doublearrow + + rightarrow.xoffset = -.2*width + leftarrow.commands = { + { "offset", width, 0, 0x20D7, -1, 1 } + } + doublearrow.commands = { + { "offset", antykwa and .9*width or width, 0, 0x20D7, -1, 1 }, + { "offset", antykwa and .1*width or 0, 0, 0x20D7, 1, 1 } + } + + -- bottom + + local rightarrow = copytable(rightarrow) + local leftarrow = copytable(leftarrow) + local doublearrow = copytable(doublearrow) + + characters[0x20EE] = leftarrow + characters[0x20EF] = rightarrow + characters[0x034D] = doublearrow + + local bheight = .40*height -- can be tuned to match top + local yoffset = -.65*height -- can be tuned to match top + + leftarrow .height = bheight + rightarrow .height = bheight + doublearrow.height = bheight + + rightarrow .yoffset = yoffset + leftarrow .yoffset = yoffset + doublearrow.yoffset = yoffset + + leftarrow.commands = { + { "offset", width, 0, 0x20D7, -1, 1 } + } + doublearrow.commands = { + { "offset", antykwa and .9*width or width, 0, 0x20D7, -1, 1 }, + { "offset", antykwa and .1*width or 0, 0, 0x20D7, 1, 1 } + } + + -- extensibles + + local tl = copytable(left) ; characters[fake20D6] = tl ; characters[0x20D6].next = fake20D6 -- over + local tm = copytable(right) ; characters[fake20D7] = tm ; characters[0x20D7].next = fake20D7 + local tr = copytable(both) ; characters[fake20E1] = tr ; characters[0x20E1].next = fake20E1 + + tl.inneryoffset = tfactor*height ; tl.innerlocation = "top" ; tl.next = nil ; tl.italic = nil + tm.inneryoffset = tfactor*height ; tm.innerlocation = "top" ; tm.next = nil ; tm.italic = nil + tr.inneryoffset = tfactor*height ; tr.innerlocation = "top" ; tr.next = nil ; tr.italic = nil + + local bl = copytable(left) ; characters[fake20EE] = bl ; characters[0x20EE].next = fake20EE -- under + local bm = copytable(right) ; characters[fake20EF] = bm ; characters[0x20EF].next = fake20EF + local br = copytable(both) ; characters[fake034D] = br ; characters[0x034D].next = fake034D - local t = copytable(left) characters[0x20D6] = t t.inneryoffset = tfactor*height t.innerlocation = "top" t.next = nil t.italic = nil -- over - local t = copytable(right) characters[0x20D7] = t t.inneryoffset = tfactor*height t.innerlocation = "top" t.next = nil t.italic = nil - local t = copytable(both) characters[0x20E1] = t t.inneryoffset = tfactor*height t.innerlocation = "top" t.next = nil t.italic = nil + bl.inneryoffset = bfactor*height bl.innerlocation = "bottom" ; bl.next = nil ; bl.italic = nil + bm.inneryoffset = bfactor*height bm.innerlocation = "bottom" ; bm.next = nil ; bm.italic = nil + br.inneryoffset = bfactor*height br.innerlocation = "bottom" ; br.next = nil ; br.italic = nil - local t = copytable(left) characters[0x20EE] = t t.inneryoffset = bfactor*height t.innerlocation = "bottom" t.next = nil t.italic = nil -- under - local t = copytable(right) characters[0x20EF] = t t.inneryoffset = bfactor*height t.innerlocation = "bottom" t.next = nil t.italic = nil - local t = copytable(both) characters[0x034D] = t t.inneryoffset = bfactor*height t.innerlocation = "bottom" t.next = nil t.italic = nil + -- local tfactor = antykwa and -15 or -15 local bfactor = antykwa and 1 or 1 diff --git a/tex/context/fonts/mkiv/concrete-math.lfg b/tex/context/fonts/mkiv/concrete-math.lfg index 142778015..e92bb122a 100644 --- a/tex/context/fonts/mkiv/concrete-math.lfg +++ b/tex/context/fonts/mkiv/concrete-math.lfg @@ -34,6 +34,9 @@ return { presets.moveitalics { correct = true }, presets.moveintegrals { factor = 1.5 }, presets.wipeitalics { }, + { + tweak = "checkaccents", + }, { tweak = "kerns", list = { diff --git a/tex/context/fonts/mkiv/dejavu-math.lfg b/tex/context/fonts/mkiv/dejavu-math.lfg index c97765122..4098a32d0 100644 --- a/tex/context/fonts/mkiv/dejavu-math.lfg +++ b/tex/context/fonts/mkiv/dejavu-math.lfg @@ -56,6 +56,9 @@ return { -- a dimension tweak before the above (e.g. 0.2 italic and 0.8 width) doesn't work -- because once the advance is set the move is blocked and the ic stil wiped. So, -- we kern. Actually the upright (ascii) f has italic correction. + { + tweak = "checkaccents", + }, { tweak = "kerns", list = { diff --git a/tex/context/fonts/mkiv/ebgaramond-math.lfg b/tex/context/fonts/mkiv/ebgaramond-math.lfg index d2ef73f55..c25147b14 100644 --- a/tex/context/fonts/mkiv/ebgaramond-math.lfg +++ b/tex/context/fonts/mkiv/ebgaramond-math.lfg @@ -50,6 +50,9 @@ return { presets.moveitalics { correct = true, letters = true }, presets.moveintegrals { factor = 1.5 }, presets.wipeitalics { }, + { + tweak = "checkaccents", + }, { tweak = "simplifykerns", }, diff --git a/tex/context/fonts/mkiv/erewhon-math.lfg b/tex/context/fonts/mkiv/erewhon-math.lfg index 223927184..5a28735f1 100644 --- a/tex/context/fonts/mkiv/erewhon-math.lfg +++ b/tex/context/fonts/mkiv/erewhon-math.lfg @@ -52,6 +52,9 @@ return { presets.moveitalics { correct = true, letters = true }, presets.moveintegrals { factor = 1.5 }, presets.wipeitalics { }, + { + tweak = "checkaccents", + }, { tweak = "kerns", list = { diff --git a/tex/context/fonts/mkiv/kpfonts-math.lfg b/tex/context/fonts/mkiv/kpfonts-math.lfg index 1b2eea45f..db3e44be8 100644 --- a/tex/context/fonts/mkiv/kpfonts-math.lfg +++ b/tex/context/fonts/mkiv/kpfonts-math.lfg @@ -25,6 +25,9 @@ return { tweak = "version", expected = "Version 0.40", }, + { + tweak = "checkaccents", + }, { tweak = "dimensions", list = { diff --git a/tex/context/fonts/mkiv/modern-math.lfg b/tex/context/fonts/mkiv/modern-math.lfg index fb9c8fd4b..fa4216263 100644 --- a/tex/context/fonts/mkiv/modern-math.lfg +++ b/tex/context/fonts/mkiv/modern-math.lfg @@ -55,6 +55,9 @@ return { presets.moveintegrals { factor = 1.4, icfactor = 0.8 }, -- the icfactor is due to the very slanted integral. presets.wipeanchors { }, presets.wipeitalics { }, + { + tweak = "checkaccents", + }, { tweak = "dimensions", list = { diff --git a/tex/context/fonts/mkiv/newcomputermodern-math.lfg b/tex/context/fonts/mkiv/newcomputermodern-math.lfg index 9e5e6ab3a..d147e787e 100644 --- a/tex/context/fonts/mkiv/newcomputermodern-math.lfg +++ b/tex/context/fonts/mkiv/newcomputermodern-math.lfg @@ -107,6 +107,9 @@ return { presets.moveintegrals { factor = 1.4, icfactor = 0.8 }, -- the icfactor is due to the very slanted integral. presets.wipeanchors { }, presets.wipeitalics { }, + { + tweak = "checkaccents", + }, { tweak = "kerns", list = { diff --git a/tex/context/fonts/mkiv/pagella-math.lfg b/tex/context/fonts/mkiv/pagella-math.lfg index a9b3ea4bb..3aa3ef24b 100644 --- a/tex/context/fonts/mkiv/pagella-math.lfg +++ b/tex/context/fonts/mkiv/pagella-math.lfg @@ -82,6 +82,9 @@ return { presets.moveintegrals { factor = 1.5 }, -- we need to check the 1.5 presets.wipeanchors { }, presets.wipeitalics { }, + { + tweak = "checkaccents", + }, { tweak = "parameters", feature = "euleroverpagella", diff --git a/tex/context/fonts/mkiv/schola-math.lfg b/tex/context/fonts/mkiv/schola-math.lfg index 58eb1a6ea..f0155cb57 100644 --- a/tex/context/fonts/mkiv/schola-math.lfg +++ b/tex/context/fonts/mkiv/schola-math.lfg @@ -46,6 +46,9 @@ return { presets.moveitalics { correct = true, letters = true }, presets.moveintegrals { }, presets.wipeitalics { }, + { + tweak = "checkaccents", + }, { tweak = "kerns", list = { diff --git a/tex/context/fonts/mkiv/stixtwo-math.lfg b/tex/context/fonts/mkiv/stixtwo-math.lfg index ebacf7a81..bbe4e3685 100644 --- a/tex/context/fonts/mkiv/stixtwo-math.lfg +++ b/tex/context/fonts/mkiv/stixtwo-math.lfg @@ -98,6 +98,19 @@ return { presets.moveitalics { correct = true, letters = true }, presets.moveintegrals { }, presets.wipeitalics { }, + { + tweak = "checkaccents", + }, + -- Extensibles use .s1 (variant 1), so we cannot wipe all + { + tweak = "wipevariants", + list = { + [0x20D6] = 3, + [0x20D7] = 3, + [0x20EE] = 3, + [0x20EF] = 3, + }, + }, { tweak = "simplifykerns", }, diff --git a/tex/context/fonts/mkiv/termes-math.lfg b/tex/context/fonts/mkiv/termes-math.lfg index 504249878..c74228179 100644 --- a/tex/context/fonts/mkiv/termes-math.lfg +++ b/tex/context/fonts/mkiv/termes-math.lfg @@ -48,6 +48,9 @@ return { presets.moveitalics { correct = true, letters = true }, presets.moveintegrals { factor = 1.5 }, presets.wipeitalics { }, + { + tweak = "checkaccents", + }, { tweak = "kerns", list = { diff --git a/tex/context/fonts/mkiv/xcharter-math.lfg b/tex/context/fonts/mkiv/xcharter-math.lfg index e2ed3e116..48b1cad5d 100644 --- a/tex/context/fonts/mkiv/xcharter-math.lfg +++ b/tex/context/fonts/mkiv/xcharter-math.lfg @@ -38,6 +38,9 @@ return { presets.moveitalics { correct = true, letters = true }, presets.moveintegrals { factor = 1.5 }, presets.wipeitalics { }, + { + tweak = "checkaccents", + }, { tweak = "kerns", list = { -- cgit v1.2.3