diff options
Diffstat (limited to 'tex/context/fonts')
-rw-r--r-- | tex/context/fonts/mkiv/asana-math.lfg | 22 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/bonum-math.lfg | 57 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/cambria-math.lfg | 72 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/dejavu-math.lfg | 48 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/ebgaramond.lfg | 46 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/libertinus-math.lfg | 99 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/lm.lfg | 127 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/lucida-opentype-math.lfg | 74 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/minion-math.lfg | 39 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/pagella-math.lfg | 113 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/schola-math.lfg | 46 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/stix-two-math.lfg | 52 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/termes-math.lfg | 61 | ||||
-rw-r--r-- | tex/context/fonts/mkiv/xits-math.lfg | 48 |
14 files changed, 524 insertions, 380 deletions
diff --git a/tex/context/fonts/mkiv/asana-math.lfg b/tex/context/fonts/mkiv/asana-math.lfg index 5b47b3ff8..fc83887a0 100644 --- a/tex/context/fonts/mkiv/asana-math.lfg +++ b/tex/context/fonts/mkiv/asana-math.lfg @@ -30,7 +30,6 @@ local function more(value,target,original) end end - return { name = "asana-math", version = "1.00", @@ -38,6 +37,27 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { + tweaks = { + aftercopying = { + { + tweak = "dimensions", + list = { + -- nothing yet + } + }, + { + tweak = "fixprimes", + factor = 1.05, + scale = 0.65, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + }, + }, parameters = { -- DisplayOperatorMinHeight = 0, -- more -- StackBottomDisplayStyleShiftDown = 0, diff --git a/tex/context/fonts/mkiv/bonum-math.lfg b/tex/context/fonts/mkiv/bonum-math.lfg index 51ca2d7f1..8daa047fb 100644 --- a/tex/context/fonts/mkiv/bonum-math.lfg +++ b/tex/context/fonts/mkiv/bonum-math.lfg @@ -1,8 +1,21 @@ -local kern_V = { bottomright = { { kern = -200 } } } -local kern_W = { bottomright = { { kern = -100 } } } -local offset_f = { xoffset = "llx" } +local dimensions, kerns if CONTEXTLMTXMODE == 0 then --- Beware of updates in ssty slots! + local kern_V = { bottomright = { { kern = -200 } } } + local kern_W = { bottomright = { { kern = -100 } } } + local offset_f = { xoffset = "llx" } + + dimensions = { + default = { + [0x1D453] = offset_f, -- 𝑓 + }, + } + + kerns = { + [0x1D449] = kern_V, -- 𝑉 + [0x1D44A] = kern_W, -- 𝑊 + } + +end return { name = "bonum-math", @@ -11,26 +24,30 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { - dimensions = { - default = { - -- [0x1D453] = offset_f, -- 𝑓 - -- ["1:0x1D453"] = offset_f, -- needed for compact - -- ["2:0x1D453"] = offset_f, -- needed for compact - ["*:0x1D453"] = offset_f, -- 𝑓 + tweaks = { + aftercopying = { + { + tweak = "dimensions", + list = { + [0x1D453] = { .40, 1.60, .5 }, -- offset width italic + }, + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "addscripts", + }, }, }, - kerns = { - -- [0x1D449] = kern_V, -- 𝑉 - -- ["1:0x1D449"] = kern_V, -- needed for compact - -- ["2:0x1D449"] = kern_V, -- needed for compact - -- [0x1D44A] = kern_W, -- 𝑊 - -- ["1:0x1D44A"] = kern_W, -- needed for compact - -- ["2:0x1D44A"] = kern_W, -- needed for compact - ["*:0x1D449"] = kern_V, -- 𝑉 - ["*:0x1D44A"] = kern_W, -- 𝑊 - }, alternates = { dotless = { feature = 'dtls', value = 1, comment = "Mathematical Dotless Forms" }, }, + -- + -- experimental fixes for mkiv: + -- + dimensions = dimensions, + kerns = kerns, }, } diff --git a/tex/context/fonts/mkiv/cambria-math.lfg b/tex/context/fonts/mkiv/cambria-math.lfg index c18854d18..6db382c45 100644 --- a/tex/context/fonts/mkiv/cambria-math.lfg +++ b/tex/context/fonts/mkiv/cambria-math.lfg @@ -6,6 +6,32 @@ -- added to the patch list. No goodies setting is needed with -- the filename. +local dimensions, kerns, kernpairs if CONTEXTLMTXMODE == 0 then + + kernpairs = { -- \setupmathematics[kernpairs=yes] + [0x1D44E] = { + [0x1D44F] = 1000, -- 𝑎𝑏 demo + } + } + + kerns = { + [0x1D453] = { + force = true, + topright = { + { + kern = 1000, + }, + }, + bottomright = { + { + kern = 1000, + }, + }, + }, + } + +end + local patches = fonts.handlers.otf.enhancers.patches local function patch(data,filename,threshold) @@ -42,28 +68,34 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { + tweaks = { + aftercopying = { + { + tweak = "dimensions", + list = { + -- nothing yet + }, + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + }, + }, parameters = { DisplayOperatorMinHeight = FixDisplayOperatorMinHeight, }, - -- kernpairs = { -- \setupmathematics[kernpairs=yes] - -- [0x1D44E] = { - -- [0x1D44F] = 1000, -- 𝑎𝑏 demo - -- } - -- }, - -- kerns = { - -- [0x1D453] = { - -- force = true, - -- topright = { - -- { - -- kern = 1000, - -- }, - -- }, - -- bottomright = { - -- { - -- kern = 1000, - -- }, - -- }, - -- }, - -- }, + -- + -- experimental fixes for mkiv: + -- + dimensions = dimensions, + kerns = kerns, + kernpairs = kernpairs, }, } diff --git a/tex/context/fonts/mkiv/dejavu-math.lfg b/tex/context/fonts/mkiv/dejavu-math.lfg index 608b396f8..44b5327de 100644 --- a/tex/context/fonts/mkiv/dejavu-math.lfg +++ b/tex/context/fonts/mkiv/dejavu-math.lfg @@ -1,7 +1,14 @@ -local kern_V = { bottomright = { { kern = -250 } } } -local kern_W = kern_W +local dimensions, kerns if CONTEXTLMTXMODE == 0 then --- Beware of updates in ssty slots! + local kern_V = { bottomright = { { kern = -250 } } } + local kern_W = kern_W + + kerns = { + [0x1D449] = kern_V, -- 𝑉 + [0x1D44A] = kern_W, -- 𝑊 + } + +end return { name = "dejavu-math", @@ -10,18 +17,35 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { - kerns = { - -- [0x1D449] = kern_V, -- 𝑉 - -- ["1:0x1D449"] = kern_V, -- needed for compact - -- ["2:0x1D449"] = kern_V, -- needed for compact - -- [0x1D44A] = kern_W, -- 𝑊 - -- ["1:0x1D44A"] = kern_W, -- needed for compact - -- ["2:0x1D44A"] = kern_W, -- needed for compact - ["*:0x1D449"] = kern_V, -- 𝑉 - ["*:0x1D44A"] = kern_W, -- 𝑊 + tweaks = { + aftercopying = { + { + tweak = "dimensions", + list = { + -- [0x1D449] = { 0, .8, .2 }, + -- [0x1D44A] = { 0, .8, .2 }, + ["0x1D449:0x1D44A"] = { 0, .8, .2 }, + } + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + }, }, alternates = { dotless = { feature = 'dtls', value = 1, comment = "Mathematical Dotless Forms" }, }, + -- + -- experimental fixes for mkiv: + -- + dimensions = dimensions, + kerns = kerns, }, } diff --git a/tex/context/fonts/mkiv/ebgaramond.lfg b/tex/context/fonts/mkiv/ebgaramond.lfg index 862e4e85d..7a509893d 100644 --- a/tex/context/fonts/mkiv/ebgaramond.lfg +++ b/tex/context/fonts/mkiv/ebgaramond.lfg @@ -5,32 +5,26 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { --- tweaks = { --- aftercopying = { --- function(target,original,...) --- local crap = { --- [0x1D453] = { .20, 1.20 }, --- [0x1D454] = { .15, 1.15 }, --- } --- local characters = target.characters --- local function adapt(k,v) --- local character = characters[k] --- local width = character.width --- character.width = v[2]*width --- -- character.commands = { { "offset", v[1]*width, 0, k } } --- character.xoffset = v[1]*width --- local smaller = original.characters[k].smaller --- if smaller and smaller ~= k then --- adapt(smaller,v) --- end --- end --- for k, v in next, crap do --- adapt(k,v) --- end --- end, --- }, --- }, - + tweaks = { + aftercopying = { + { + tweak = "dimensions", + list = { + [0x1D453] = { 0, 1, .2 }, -- offset width italic + }, + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + }, + }, alternates = { partial = { feature = 'ss02', value = 1, comment = "Curved partial" }, semibold = { feature = 'ss04', value = 1, comment = "Semibold" }, diff --git a/tex/context/fonts/mkiv/libertinus-math.lfg b/tex/context/fonts/mkiv/libertinus-math.lfg index c02f0506a..a0e9b5c23 100644 --- a/tex/context/fonts/mkiv/libertinus-math.lfg +++ b/tex/context/fonts/mkiv/libertinus-math.lfg @@ -13,89 +13,22 @@ return { mathematics = { tweaks = { aftercopying = { - -- function(target,original) - -- local okay = 983068 - -- local crap = { - -- ["minute"] = "minute.ssty1", - -- ["second"] = "second.ssty1", - -- -- [8242] = 983068, - -- -- [8243] = 983069, - -- [8244] = 983070, - -- [8245] = 983071, - -- [8246] = 983072, - -- [8247] = 983073, - -- } - -- local characters = target.characters - -- local unicodes = original.resources.unicodes - -- if unicodes["minute.ssty1"] == okay then - -- for old, new in next, crap do - -- if type(old) == "string" then - -- old = unicodes[old] - -- end - -- if type(new) == "string" then - -- new = unicodes[new] - -- end - -- if old and new and characters[old] then - -- local c = characters[new] - -- if c then - -- characters[old] = c - -- c.commands = { { "up", .06 * c.height }, { "slot", 0, new, .7 } } - -- end - -- end - -- end - -- local four = characters[0x2057] - -- if four then - -- local one = characters[okay] - -- local owd = .75*one.width - -- local off = .6*one.height - -- four.width = 4*owd - -- four.commands = { - -- { "offset", 0, off, okay }, - -- { "offset", owd, off, okay }, - -- { "offset", 2*owd, off, okay }, - -- { "offset", 3*owd, off, okay }, - -- } - -- else - -- -- we don't add (but we could), just patch, and there's no - -- -- reverse quad either - -- end - -- else - -- logs.report("fonts","the libertinus tweaks need to be checked") - -- end - -- end, - function(target,original) - local crap = { 0x2032, 0x2033, 0x2034, 0x2036, 0x2037, 0x2038 } -- 0x2057 - local characters = target.characters - local originals = original.characters - local unicodes = original.resources.unicodes - for i=1,#crap do - local old = crap[i] - local chr = characters[slot] - if chr then - local new = chr.smaller - if new then - local c = characters[new] - if c then - characters[old] = c - c.commands = { { "up", .06 * c.height }, { "slot", 0, new, .7 } } - end - end - end - end - local four = characters[0x2057] - if four then - local one = characters[0x2032] - local owd = .75*one.width - local off = .6*one.height - four.width = 4*owd - four.commands = { - { "offset", 0, off, okay }, - { "offset", owd, off, okay }, - { "offset", 2*owd, off, okay }, - { "offset", 3*owd, off, okay }, - } - end - end, + { + tweak = "dimensions", + list = { + -- nothing yet + }, + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, }, }, }, diff --git a/tex/context/fonts/mkiv/lm.lfg b/tex/context/fonts/mkiv/lm.lfg index ec37a2975..6039471e3 100644 --- a/tex/context/fonts/mkiv/lm.lfg +++ b/tex/context/fonts/mkiv/lm.lfg @@ -1,8 +1,52 @@ -- In order to be able to use beta math fonts, we use our own file name and -- always remap. -local kern_150 = { bottomright = { { kern = -150 } } } -local kern_200 = { bottomright = { { kern = -200 } } } +local dimensions, kerns if CONTEXTLMTXMODE == 0 then + + local kern_150 = { bottomright = { { kern = -150 } } } + local kern_200 = { bottomright = { { kern = -200 } } } + + kerns = { + [0x1D449] = kern_150, -- + [0x1D44A] = kern_200, -- 𝑊 + } + + dimensions = { + -- always applied + -- default = { + -- }, + -- driven by 'mathdimensions' feature + default = { + -- the root is quite displaced + [0x221A] = { + -- 73, -960, 853, 40 + yoffset = 960 - 40, + height = 960, + depth = 40, + }, + -- [0xFE932] = { xoffset = 50, width = 290 }, -- used prime + -- [0x2032] = { xoffset = 50, width = 290 }, -- prime + }, + -- -- seems ok now -- + -- signs = { + -- -- [0x00B1] = { -- ± + -- -- height = 500, depth = 0, + -- -- }, + -- -- [0x2213] = { -- ∓ + -- -- height = 500, depth = 0, + -- -- }, + -- -- move in boundingbox + -- [0x00B1] = { -- ± + -- yoffset = 100, + -- }, + -- [0x2213] = { -- ∓ + -- yoffset = -100, + -- }, + -- }, + } + +end + return { name = "latin modern", @@ -13,58 +57,43 @@ return { mathematics = { tweaks = { aftercopying = { - mathematics.tweaks.fixbadprime, -- prime is too low - -- mathematics.tweaks.fixoverline, - }, - }, - kerns = { - [0x1D449] = kern_150, -- - [0x1D44A] = kern_200, -- 𝑊 - }, - dimensions = { - -- always applied - -- default = { - -- }, - -- driven by 'mathdimensions' feature - default = { - -- the root is quite displaced - [0x221A] = { - -- 73, -960, 853, 40 - yoffset = 960 - 40, - height = 960, - depth = 40, + { + tweak = "dimensions", + list = { + -- nothing yet + }, }, - -- [0xFE932] = { xoffset = 50, width = 290 }, -- used prime - -- [0x2032] = { xoffset = 50, width = 290 }, -- prime - }, - signs = { - -- set dimensions - -- [0x00B1] = { -- ± - -- height = 500, depth = 0, - -- }, - -- [0x2213] = { -- ∓ - -- height = 500, depth = 0, - -- }, - -- move in boundingbox - [0x00B1] = { -- ± - yoffset = 100, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "checkspacing", + }, + { + tweak = "fixradicals", }, - [0x2213] = { -- ∓ - yoffset = -100, + { + tweak = "addscripts", }, }, }, --- parameters = { --- FractionNumeratorDisplayStyleShiftUp = function(value,target,original) --- local o = original.mathparameters.FractionNumeratorDisplayStyleShiftUp --- if o > 675 then --- o = 600 --- else --- -- probably tuned --- end --- return o * target.parameters.factor --- end, --- } + parameters = { + FractionNumeratorDisplayStyleShiftUp = function(value,target,original) + local o = original.mathparameters.FractionNumeratorDisplayStyleShiftUp + if o > 675 then + o = 600 + else + -- probably tuned + end + return o * target.parameters.factor + end, + }, + -- + -- experimental fixes for mkiv: + -- + dimensions = dimensions, + kerns = kerns, }, filenames = { ["latinmodern-math-regular.otf"] = { diff --git a/tex/context/fonts/mkiv/lucida-opentype-math.lfg b/tex/context/fonts/mkiv/lucida-opentype-math.lfg index 7596f139a..024284bd2 100644 --- a/tex/context/fonts/mkiv/lucida-opentype-math.lfg +++ b/tex/context/fonts/mkiv/lucida-opentype-math.lfg @@ -1,4 +1,29 @@ ------ kern_250 = { bottomright = { { kern = -250 } }, force = true } +local dimensions, kerns if CONTEXTLMTXMODE == 0 then + + -- local kern_250 = { bottomright = { { kern = -250 } }, force = true } + + + -- kerns = { + -- [0x1D449] = kern_250, -- + -- [0x1D44A] = kern_250, -- 𝑊 + -- } + + dimensions = { + default = { -- experimental values + [0x02044] = { xoffset = 275, width = 600 }, + -- primes + [0xFE932] = { width = 200 }, + [0xFE933] = { width = 500 }, + [0xFE934] = { width = 800 }, + [0xFE935] = { width = 1100 }, + -- reverse primes + [0xFE935] = { width = 200 }, + [0xFE936] = { width = 500 }, + [0xFE937] = { width = 800 }, + }, + } + +end -- RadicalVerticalGap = 50 -- RadicalDisplayStyleVerticalGap = 175 @@ -18,6 +43,30 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { + tweaks = { + aftercopying = { + { + tweak = "dimensions", + list = { + -- nothing yet + }, + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "fakeprimes", + factor = 0.75, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + }, + }, parameters = { RadicalDisplayStyleVerticalGap = FixRadicalDisplayStyleVerticalGap, }, @@ -29,23 +78,10 @@ return { zero = { feature = 'ss05', value = 1, comment = "Mathematical Alternative Zero" }, partial = { feature = 'ss20', value = 1, comment = "Mathematical Alternative Upright Partial Differential" }, }, - -- kerns = { - -- [0x1D449] = kern_250, -- - -- [0x1D44A] = kern_250, -- 𝑊 - -- }, - dimensions = { - default = { -- experimental values - [0x02044] = { xoffset = 275, width = 600 }, - -- primes - [0xFE932] = { width = 200 }, - [0xFE933] = { width = 500 }, - [0xFE934] = { width = 800 }, - [0xFE935] = { width = 1100 }, - -- reverse primes - [0xFE935] = { width = 200 }, - [0xFE936] = { width = 500 }, - [0xFE937] = { width = 800 }, - }, - }, + -- + -- experimental fixes for mkiv: + -- + dimensions = dimensions, + kerns = kerns, }, } diff --git a/tex/context/fonts/mkiv/minion-math.lfg b/tex/context/fonts/mkiv/minion-math.lfg index 863836c1c..13d11edc6 100644 --- a/tex/context/fonts/mkiv/minion-math.lfg +++ b/tex/context/fonts/mkiv/minion-math.lfg @@ -1,5 +1,14 @@ -local kern_W = { bottomright = { { kern = -150 } } } -local kern_V = { bottomright = { { kern = -200 } } } +local dimensions, kerns if CONTEXTLMTXMODE == 0 then + + local kern_W = { bottomright = { { kern = -150 } } } + local kern_V = { bottomright = { { kern = -200 } } } + + kerns = { + [0x1D449] = kern_V, -- 𝑉 + [0x1D44A] = kern_W, -- 𝑊 + } + +end return { name = "minion-math", @@ -21,10 +30,28 @@ return { }, }, mathematics = { - kerns = { - [0x1D449] = kern_V, -- 𝑉 - [0x1D44A] = kern_W, -- 𝑊 - -- todo: ssty 1/2 + tweaks = { + aftercopying = { + { + tweak = "dimensions", + list = dimensions, + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + }, }, + -- + -- experimental fixes for mkiv: + -- + dimensions = dimensions, + kerns = kerns, }, } diff --git a/tex/context/fonts/mkiv/pagella-math.lfg b/tex/context/fonts/mkiv/pagella-math.lfg index e2ed0eb43..3926ae95b 100644 --- a/tex/context/fonts/mkiv/pagella-math.lfg +++ b/tex/context/fonts/mkiv/pagella-math.lfg @@ -1,7 +1,31 @@ -local dimensions = { - [0x1D453] = { .40, 1.60, .5 }, -- offset width italic --- [0x1D453] = { .0, 2, 0 }, -- offset width italic -} +local dimensions, kerns if CONTEXTLMTXMODE == 0 then + + local kern_V = { bottomright = { { kern = -200 } } } + local kern_W = { bottomright = { { kern = -100 } } } + + dimensions = { + default = { + -- [0x1D453] = { xoffset = 162, width = 278 + 162 },-- 𝑓 + -- [0x1D453] = offset_f, -- 𝑓 + -- ["1:0x1D453"] = offset_f, -- needed for compact + -- ["2:0x1D453"] = offset_f, -- needed for compact +-- ["*:0x1D453"] = offset_f, -- 𝑓 + }, + } + + kerns = { + -- [0x1D449] = kern_V, -- 𝑉 + -- ["1:0x1D449"] = kern_V, -- needed for compact + -- ["2:0x1D449"] = kern_V, -- needed for compact + -- [0x1D44A] = kern_W, -- 𝑊 + -- ["1:0x1D44A"] = kern_W, -- needed for compact + -- ["2:0x1D44A"] = kern_W, -- needed for compact + -- ["*:0x1D453"] = kern_f, + ["*:0x1D449"] = kern_V, -- 𝑉 + ["*:0x1D44A"] = kern_W, -- 𝑊 + } + +end return { name = "pagella-math", @@ -12,54 +36,47 @@ return { mathematics = { tweaks = { aftercopying = { - { "version", "Version 1.632" }, - -- { "action", function(target,original) mathematics.tweaks.fixdimensions(target, original, fixes) }, - -- { "action", mathematics.tweaks.fixdimensions, fixes }, - { "dimensions", dimensions }, + -- { + -- tweak = "version", + -- expected = "Version 1.632", + -- }, + -- { + -- comment = "example" + -- tweak = "action", + -- action = function(target,original,parameters) mathematics.tweaks.fixdimensions(target, original, parameters) + -- list = fixes, -- one of the parameters + -- }, + -- { + -- comment = "example" + -- tweak = "action", + -- action = mathematics.tweaks.fixdimensions, + -- list = fixes, -- one of the parameters + -- }, + { + tweak = "dimensions", + list = { + [0x1D453] = { .40, 1.60, .5 }, -- offset width italic + }, + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, }, }, alternates = { dotless = { feature = 'dtls', value = 1, comment = "Mathematical Dotless Forms" }, }, + -- + -- experimental fixes for mkiv: + -- + dimensions = dimensions, + kerns = kerns, }, } - --- local kern_V = { bottomright = { { kern = -200 } } } --- local kern_W = { bottomright = { { kern = -100 } } } --- ----- kern_f = { bottomright = { { kern = -100 } } } --- -- local offset_f = { xoffset = "llx" } --- --- -- Beware of updates in ssty slots! --- --- return { --- name = "pagella-math", --- version = "1.00", --- comment = "Goodies that complement pagella.", --- author = "Hans Hagen", --- copyright = "ConTeXt development team", --- mathematics = { --- dimensions = { --- default = { --- -- [0x1D453] = { xoffset = 162, width = 278 + 162 },-- 𝑓 --- -- [0x1D453] = offset_f, -- 𝑓 --- -- ["1:0x1D453"] = offset_f, -- needed for compact --- -- ["2:0x1D453"] = offset_f, -- needed for compact --- -- ["*:0x1D453"] = offset_f, -- 𝑓 --- }, --- }, --- kerns = { --- -- [0x1D449] = kern_V, -- 𝑉 --- -- ["1:0x1D449"] = kern_V, -- needed for compact --- -- ["2:0x1D449"] = kern_V, -- needed for compact --- -- [0x1D44A] = kern_W, -- 𝑊 --- -- ["1:0x1D44A"] = kern_W, -- needed for compact --- -- ["2:0x1D44A"] = kern_W, -- needed for compact --- -- ["*:0x1D453"] = kern_f, --- ["*:0x1D449"] = kern_V, -- 𝑉 --- ["*:0x1D44A"] = kern_W, -- 𝑊 --- }, --- alternates = { --- dotless = { feature = 'dtls', value = 1, comment = "Mathematical Dotless Forms" }, --- }, --- }, --- } diff --git a/tex/context/fonts/mkiv/schola-math.lfg b/tex/context/fonts/mkiv/schola-math.lfg index b60bc6d99..0a4d66892 100644 --- a/tex/context/fonts/mkiv/schola-math.lfg +++ b/tex/context/fonts/mkiv/schola-math.lfg @@ -1,7 +1,14 @@ -local kern_V = { bottomright = { { kern = -200 } }, topright = { { kern = 50 } } } -local kern_W = { bottomright = { { kern = -100 } }, topright = { { kern = 50 } } } +local dimensions, kerns if CONTEXTLMTXMODE == 0 then --- Beware of updates in ssty slots! + local kern_V = { bottomright = { { kern = -200 } }, topright = { { kern = 50 } } } + local kern_W = { bottomright = { { kern = -100 } }, topright = { { kern = 50 } } } + + kerns = { + [0x1D449] = kern_V, -- 𝑉 + [0x1D44A] = kern_W, -- 𝑊 + } + +end return { name = "schola-math", @@ -10,18 +17,33 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { - kerns = { - -- [0x1D449] = kern_V, -- 𝑉 - -- ["1:0x1D449"] = kern_V, -- needed for compact - -- ["2:0x1D449"] = kern_V, -- needed for compact - -- [0x1D44A] = kern_W, -- 𝑊 - -- ["1:0x1D44A"] = kern_W, -- needed for compact - -- ["2:0x1D44A"] = kern_W, -- needed for compact - ["*:0x1D449"] = kern_V, -- 𝑉 - ["*:0x1D44A"] = kern_W, -- 𝑊 + tweaks = { + aftercopying = { + { + tweak = "dimensions", + list = { + -- nothing yet + } + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + }, }, alternates = { dotless = { feature = 'dtls', value = 1, comment = "Mathematical Dotless Forms" }, }, + -- + -- experimental fixes for mkiv: + -- + dimensions = dimensions, + kerns = kerns, }, } diff --git a/tex/context/fonts/mkiv/stix-two-math.lfg b/tex/context/fonts/mkiv/stix-two-math.lfg index 8d9c9c71a..cc09da04b 100644 --- a/tex/context/fonts/mkiv/stix-two-math.lfg +++ b/tex/context/fonts/mkiv/stix-two-math.lfg @@ -1,34 +1,3 @@ --- Bah, I really hate these patches especially because one needs to make --- sure that they are still valid when the font gets updated. So, let's --- do it runtime (not in the cached copy) and issue a warning every run. --- As we cannot rely on version numbers (if we have more patches) we --- check for values instead. --- --- This font also has inconsistent italics in smaller sizes which we can --- fix in a more general way but I'm not sure if we want that. - -local function fix_italic(target,original,name,value,factor) - local m = target.parameters.mathsize - if m then - local u = type(name) == "number" and name or original.resources.unicodes[name] - if u then - local c = target.characters[u] - if c then - local i = c.italic - if i then - local d = original.descriptions[u] - if d and d.math.italic == value then - if m then - logs.report("patching font","fixing italic correction of %U at math size %i by %0.3f",u,m,factor) - c.italic = factor * i - end - end - end - end - end - end -end - return { name = "stix-two-math", version = "1.00", @@ -36,7 +5,6 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { - -- these tags are suggestions and can still change alternates = { calligraphic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Calligraphic Characters" }, italic = { feature = 'ss02', value = 1, comment = "Mathematical Alternative Lowercase Italic" }, @@ -54,10 +22,22 @@ return { }, tweaks = { aftercopying = { - function(target,original) - fix_italic(target,original,"uni222B.updsp",80,3.5) - fix_italic(target,original,"uni222B.up", 80,2.5) - end, + { + tweak = "dimensions", + list = { + -- nothing yet + }, + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, }, }, }, diff --git a/tex/context/fonts/mkiv/termes-math.lfg b/tex/context/fonts/mkiv/termes-math.lfg index da5a13d77..8752f0a3b 100644 --- a/tex/context/fonts/mkiv/termes-math.lfg +++ b/tex/context/fonts/mkiv/termes-math.lfg @@ -1,8 +1,22 @@ -local kern_V = { bottomright = { { kern = -200 } } } -local kern_W = { bottomright = { { kern = -100 } } } --- local offset_f = { xoffset = "llx" } +local dimensions, kerns if CONTEXTLMTXMODE == 0 then + + -- local kern_V = { bottomright = { { kern = -200 } } } + -- local kern_W = { bottomright = { { kern = -100 } } } + -- local offset_f = { xoffset = "llx" } + -- + -- dimensions = { + -- default = { + -- [0x1D453] = offset_f, -- 𝑓 + -- }, + -- } + -- + -- kerns = { + -- [0x1D449] = kern_V, -- 𝑉 + -- [0x1D44A] = kern_W, -- 𝑊 + -- } + +end --- Beware of updates in ssty slots! return { name = "termes-math", @@ -11,26 +25,33 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { - dimensions = { - default = { - -- [0x1D453] = offset_f, -- 𝑓 - -- ["1:0x1D453"] = offset_f, -- needed for compact - -- ["2:0x1D453"] = offset_f, -- needed for compact --- ["*:0x1D453"] = offset_f, -- 𝑓 + tweaks = { + aftercopying = { + { + tweak = "dimensions", + list = { + -- nothing yet + }, + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, }, }, - kerns = { - -- [0x1D449] = kern_V, -- 𝑉 - -- ["1:0x1D449"] = kern_V, -- needed for compact - -- ["2:0x1D449"] = kern_V, -- needed for compact - -- [0x1D44A] = kern_W, -- 𝑊 - -- ["1:0x1D44A"] = kern_W, -- needed for compact - -- ["2:0x1D44A"] = kern_W, -- needed for compact - ["*:0x1D449"] = kern_V, -- 𝑉 - ["*:0x1D44A"] = kern_W, -- 𝑊 - }, alternates = { dotless = { feature = 'dtls', value = 1, comment = "Mathematical Dotless Forms" }, }, + -- + -- experimental fixes for mkiv: + -- + dimensions = dimensions, + kerns = kerns, }, } diff --git a/tex/context/fonts/mkiv/xits-math.lfg b/tex/context/fonts/mkiv/xits-math.lfg index 88d3a8d45..f166afc80 100644 --- a/tex/context/fonts/mkiv/xits-math.lfg +++ b/tex/context/fonts/mkiv/xits-math.lfg @@ -1,23 +1,3 @@ --- \setupbodyfont[xits] --- --- $ABC$ $\cal ABC$ $\mathalternate{cal}\cal ABC$ --- --- \setupmathematics[italics=1] test $a;b;a; b; f;$ test\par % fontitalics --- \setupmathematics[italics=2] test $a;b;a; b; f;$ test\par % fontdata --- \setupmathematics[italics=3] test $a;b;a; b; f;$ test\par % quad based --- \setupmathematics[italics=4] test $a;b;a; b; f;$ test\par % combination of 1 and 3 - -local italics = { - defaultfactor = 0.025, - disableengine = true, - corrections = { - -- [0x1D44E] = 0.99, -- a (fraction of quad) - -- [0x1D44F] = 100, -- b (font points) - [0x1D453] = -0.0375, -- f - -- todo: ssty 1/2 - } -} - return { name = "xits-math", version = "1.00", @@ -35,14 +15,26 @@ return { }, }, mathematics = { - -- italics = { - -- ["xits-math"] = italics, - -- }, - -- kernpairs = { - -- [0x1D44A] = { -- 𝑊 - -- [0x1D434] = -200, -- 𝐴 - -- }, - -- }, + tweaks = { + aftercopying = { + { + tweak = "dimensions", + list = { + -- nothing yet + }, + }, + { + tweak = "fixprimes", + factor = 0.85, + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + }, + }, alternates = { calligraphic = { feature = 'ss01', value = 1, comment = "Mathematical Calligraphic Alphabet" }, greekssup = { feature = 'ss02', value = 1, comment = "Mathematical Greek Sans Serif Alphabet" }, |