summaryrefslogtreecommitdiff
path: root/tex/context/fonts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-11-02 10:26:54 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-11-02 10:26:54 +0100
commitca2f0f64dbb46140d36db84ac6e1b6079a386cfa (patch)
tree51addfb2ea0320820d9d566d2f26206ba200bc21 /tex/context/fonts
parentc0e2193b6c379b34fbc589343d31f71e02513f03 (diff)
downloadcontext-ca2f0f64dbb46140d36db84ac6e1b6079a386cfa.tar.gz
2021-11-02 10:02:00
Diffstat (limited to 'tex/context/fonts')
-rw-r--r--tex/context/fonts/mkiv/ebgaramond.lfg38
-rw-r--r--tex/context/fonts/mkiv/libertinus-math.lfg110
-rw-r--r--tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv24
3 files changed, 124 insertions, 48 deletions
diff --git a/tex/context/fonts/mkiv/ebgaramond.lfg b/tex/context/fonts/mkiv/ebgaramond.lfg
index 43cc13c51..73f3e6b70 100644
--- a/tex/context/fonts/mkiv/ebgaramond.lfg
+++ b/tex/context/fonts/mkiv/ebgaramond.lfg
@@ -4,6 +4,44 @@ return {
comment = "Goodies that complement eb garamond.",
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,
+ },
+ },
+
+ alternates = {
+ partial = { feature = 'ss02', value = 1, comment = "Curved partial" },
+ semibold = { feature = 'ss04', value = 1, comment = "Semibold" },
+ extrabold = { feature = 'ss05', value = 1, comment = "Extrabold" },
+ hbar = { feature = 'ss06', value = 1, comment = "Horizontal bar for h-bar" },
+ integral = { feature = 'ss07', value = 1, comment = "A more slanted integral sign" },
+ tilde = { feature = 'ss09', value = 1, comment = "A tilde variant" },
+ outbendingh = { feature = 'ss10', value = 1, comment = "Out-bending h" },
+ largeoperators = { feature = 'ss11', value = 1, comment = "Larger operators" },
+ },
+ },
designsizes = {
["EBGaramond-Italic"] = {
["8pt"] = "file:EBGaramond08-Italic",
diff --git a/tex/context/fonts/mkiv/libertinus-math.lfg b/tex/context/fonts/mkiv/libertinus-math.lfg
index b6621b946..c02f0506a 100644
--- a/tex/context/fonts/mkiv/libertinus-math.lfg
+++ b/tex/context/fonts/mkiv/libertinus-math.lfg
@@ -13,29 +13,67 @@ 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 okay = 983068
- local crap = {
- ["minute"] = "minute.ssty1",
- ["second"] = "second.ssty1",
- -- [8242] = 983068,
- -- [8243] = 983069,
- [8244] = 983070,
- [8245] = 983071,
- [8246] = 983072,
- [8247] = 983073,
- }
+ local crap = { 0x2032, 0x2033, 0x2034, 0x2036, 0x2037, 0x2038 } -- 0x2057
local characters = target.characters
+ local originals = original.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
+ 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
@@ -43,28 +81,22 @@ return {
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
+ 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,
},
},
},
}
-
diff --git a/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv b/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv
index 5cafe503f..87f8b5cad 100644
--- a/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv
@@ -57,19 +57,25 @@
% \definetypeface [ebgaramond] [mm] [math] [bonum] [default] [rscale=0.8] % rather arbitrary but seldom mixed anyway
% \stoptypescript
- \starttypescript [serif] [ebgaramond]
+ \starttypescript [\s!serif] [ebgaramond]
\setups[font:fallback:serif]
- \definefontsynonym [Serif] [file:ebgaramond-regular] [features=eb-garamond-normal]
- \definefontsynonym [SerifItalic] [file:ebgaramond-italic] [features=eb-garamond-normal]
- \definefontsynonym [SerifBold] [file:ebgaramond-bold] [features=eb-garamond-normal]
- \definefontsynonym [SerifBoldItalic][file:ebgaramond-bolditalic][features=eb-garamond-normal]
- \definefontsynonym [SerifCaps] [Serif] [features=eb-garamond-smallcaps]
+ \definefontsynonym [\s!Serif] [\s!file:ebgaramond-regular] [\s!features=eb-garamond-normal]
+ \definefontsynonym [\s!SerifItalic] [\s!file:ebgaramond-italic] [\s!features=eb-garamond-normal]
+ \definefontsynonym [\s!SerifBold] [\s!file:ebgaramond-bold] [\s!features=eb-garamond-normal]
+ \definefontsynonym [\s!SerifBoldItalic][\s!file:ebgaramond-bolditalic][\s!features=eb-garamond-normal]
+ \definefontsynonym [\s!SerifCaps] [\s!Serif] [\s!features=eb-garamond-smallcaps]
+ \stoptypescript
+
+ \starttypescript [\s!math] [ebgaramond] [\s!name]
+ \loadfontgoodies[ebgaramond]
+ \definefontsynonym [\s!MathRoman] [\s!file:garamond-math.otf] [\s!features=\s!math\mathsizesuffix,\s!goodies=ebgaramond]
\stoptypescript
\starttypescript[ebgaramond]
- \definetypeface [ebgaramond] [rm] [serif] [ebgaramond] [default]
- \definetypeface [ebgaramond] [tt] [mono] [dejavu] [default] [rscale=0.8] % rather arbitrary but seldom mixed anyway
- \definetypeface [ebgaramond] [mm] [math] [bonum] [default] [rscale=0.8] % rather arbitrary but seldom mixed anyway
+ \definetypeface [ebgaramond] [\s!rm] [\s!serif] [ebgaramond] [\s!default]
+ \definetypeface [ebgaramond] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.8] % rather arbitrary but seldom mixed anyway
+ % \definetypeface [ebgaramond] [\s!mm] [\s!math] [bonum] [\s!default] [\s!rscale=0.8] % rather arbitrary but seldom mixed anyway
+ \definetypeface [ebgaramond] [\s!mm] [\s!math] [ebgaramond] [\s!default]
\stoptypescript
\stoptypescriptcollection