summaryrefslogtreecommitdiff
path: root/tex/context/fonts/mkiv/cambria-math.lfg
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/fonts/mkiv/cambria-math.lfg')
-rw-r--r--tex/context/fonts/mkiv/cambria-math.lfg102
1 files changed, 68 insertions, 34 deletions
diff --git a/tex/context/fonts/mkiv/cambria-math.lfg b/tex/context/fonts/mkiv/cambria-math.lfg
index d641784d7..4fe564cea 100644
--- a/tex/context/fonts/mkiv/cambria-math.lfg
+++ b/tex/context/fonts/mkiv/cambria-math.lfg
@@ -32,34 +32,21 @@ local dimensions, kerns, kernpairs if CONTEXTLMTXMODE == 0 then
end
-local patches = fonts.handlers.otf.enhancers.patches
-
-local function patch(data,filename,threshold)
- local m = data.metadata.math
- if m then
- local d = m.DisplayOperatorMinHeight or 0
- if d < threshold then
- patches.report("DisplayOperatorMinHeight(%s -> %s)",d,threshold)
- m.DisplayOperatorMinHeight = threshold
- end
- end
-end
-
-patches.register("after","analyze math","cambria", function(data,filename) patch(data,filename,2800) end)
-patches.register("after","analyze math","cambmath",function(data,filename) patch(data,filename,2800) end)
-
--- This is a runtime fix, but then we need to explicitly set
--- the goodies parameter for the font. As a demonstration we
--- we do both.
-
-local function FixDisplayOperatorMinHeight(value,target,original)
- local o = original.mathparameters.DisplayOperatorMinHeight
- if o < 2800 then
- return 2800 * target.parameters.factor
- else
- return value -- already scaled
- end
-end
+-- local patches = fonts.handlers.otf.enhancers.patches
+--
+-- local function patch(data,filename,threshold)
+-- local m = data.metadata.math
+-- if m then
+-- local d = m.DisplayOperatorMinHeight or 0
+-- if d < threshold then
+-- patches.report("DisplayOperatorMinHeight(%s -> %s)",d,threshold)
+-- m.DisplayOperatorMinHeight = threshold
+-- end
+-- end
+-- end
+--
+-- patches.register("after","analyze math","cambria", function(data,filename) patch(data,filename,2800) end)
+-- patches.register("after","analyze math","cambmath",function(data,filename) patch(data,filename,2800) end)
return {
name = "cambria-math",
@@ -68,19 +55,49 @@ return {
author = "Hans Hagen",
copyright = "ConTeXt development team",
mathematics = {
+ parameters = {
+ NoLimitSupFactor = 0,
+ NoLimitSubFactor = 1000,
+ DisplayOperatorMinHeight = 2800,
+ AccentBaseDepth = 300,
+ },
tweaks = {
aftercopying = {
{
tweak = "dimensions",
list = {
- [0x1D43D] = { 0.25, 1.15, 0.2}, -- J
+ -- [0x00060] = { yoffset = -0.1 }, -- grave
+ -- [0x000B4] = { yoffset = -0.1 }, -- acute
+ -- [0x002C6] = { yoffset = -0.1 }, -- hat
+ -- [0x002DC] = { yoffset = -0.1 }, -- tilde
+ -- [0x000AF] = { yoffset = -0.1 }, -- bar
+ -- [0x002D8] = { yoffset = -0.15 }, -- breve
+ -- [0x002D9] = { yoffset = -0.15 }, -- dot
+ -- [0x000A8] = { yoffset = -0.1 }, -- ddot
+ [0x020DB] = { yoffset = -0.05 }, -- dddot
+ -- [0x002C7] = { yoffset = -0.1 }, -- check
+ [0x020D7] = { yoffset = -0.05 }, -- vec
+ -- [0x00300] = { yoffset = -0.12 , all=true }, -- widegrave
+ -- [0x00301] = { yoffset = -0.12 , all=true }, -- wideacute
+ -- [0x00302] = { yoffset = -0.12 , all=true }, -- widehat
+ -- [0x00303] = { yoffset = -0.12 , all=true }, -- widetilde
+ -- [0x00304] = { yoffset = -0.12 , all=true }, -- widebar
+ -- [0x00306] = { yoffset = -0.12 , all=true }, -- widebreve
+ [0x00307] = { yoffset = -0.025 , all=true }, -- widedot
+ [0x00308] = { yoffset = -0.025 , all=true }, -- wideddot
+ -- [0x020DB] = { yoffset = -0.1 , all=true }, -- widedddot
+ -- [0x0030A] = { yoffset = -0.12 , all=true }, -- widering
+ -- [0x0030C] = { yoffset = -0.12 , all=true }, -- widecheck
+ [0x1D43D] = { 0.25, 1.15, 0.2 }, -- J
+ [0x1D487] = { anchor = 0.8 }, -- bold lower case italic f
+ -- [0x1D487] = { 0, 1, 0, 1.3}, -- bold lower case italic f
},
},
{
tweak = "fixprimes",
- scale = 0.7,
- smaller = true,
- factor = 0.8,
+ scale = 0.9,
+ -- smaller = true,
+ factor = 0.9,
},
{
tweak = "checkspacing",
@@ -88,10 +105,27 @@ return {
{
tweak = "addscripts",
},
+ {
+ tweak = "accentdimensions",
+ list = { "over", "under" },
+ -- list = {
+ -- [0x203E] = { factor = "over" }, -- overbar
+ -- [0x203E] = { factor = "under" }, -- underbar
+ -- [0x23DE] = { factor = "over" }, -- overbrace
+ -- [0x23DF] = { factor = "under" }, -- underbrace
+ -- [0x23DC] = { factor = "over" }, -- overparent
+ -- [0x23DD] = { factor = "under" }, -- underparent
+ -- [0x23B4] = { factor = "over" }, -- overbracket
+ -- [0x23B5] = { factor = "under" }, -- underbracket
+ -- }
+ },
+ {
+ tweak = "addrules",
+ },
},
},
- parameters = {
- DisplayOperatorMinHeight = FixDisplayOperatorMinHeight,
+ bigslots = {
+ 1, 2, 3, 4
},
--
-- experimental fixes for mkiv: