erewhon-math.lfg /size: 6294 b    last modification: 2025-02-21 11:03
1-- This font is under active development so we don't want to tweek it too much
2-- before all issues are sorted out.
3
4local common  = fonts.goodies.load("common-math.lfg")
5local presets = common.mathematics.tweaks.presets
6
7return {
8    name = "erewhon-math",
9    version = "1.00",
10    comment = "Goodies that complement erewhon math.",
11    author = "Hans Hagen & Mikael Sundqvist",
12    copyright = "ConTeXt development team",
13    mathematics = {
14        parameters = {
15            AccentBaseDepth                   =  60,
16            DelimiterPercent                  =  85,
17            DelimiterShortfall                = 400,
18            DelimiterDisplayPercent           =  90,
19            DelimiterDisplayShortfall         = 400,
20            SubscriptShiftDown                = 200, -- 220 in font
21            SuperscriptShiftUp                = 400, -- 400 in font
22            SubscriptShiftDownWithSuperscript = "1.2*SubscriptShiftDown", -- unclear original value, trial and error
23            PrimeShiftUp                      = "1*SuperscriptShiftUp",
24            PrimeShiftUpCramped               = "1*SuperscriptShiftUp",
25            PrimeBaselineDropMax              = "0.5*SuperscriptBaselineDropMax",
26            RadicalDisplayStyleVerticalGap    = "RadicalVerticalGap", --170, 69
27            -- RadicalDisplayStyleVerticalGap    = 55,--"RadicalVerticalGap", --170, 69
28            -- RadicalVerticalGap                = 55,
29        },
30        tweaks = {
31            aftercopying = {
32                {
33                    tweak  = "fixprimes",
34                    factor = 0.94  ,
35                    fake   = 0.85, -- replace multiples with this width proportion
36                },
37                {
38                    tweak = "addmirrors",
39                },
40                {
41                    tweak = "addcomposites",
42                },
43             -- {
44             --     tweak   = "dimensions",
45             --     comment = "no longer needed",
46             --     list    = {
47             --         ["0x222B.variants.*"] = { axis = .15 },
48             --     },
49             -- },
50                {
51                    tweak = "fixintegrals",
52                },
53                presets.scripttocalligraphic { },
54                presets.rsfstoscript         { },
55                presets.rsfsuprighttoscript  { },
56                presets.moderntocalligraphic { },
57                presets.eulertocalligraphic  { },
58                presets.xitsarabic           { rscale  = 0.90 },
59                presets.fallbacks            { },
60                presets.moveitalics          { correct = true },
61                presets.moveitalics          { correct = true, letters = true },
62                presets.moveintegrals        { factor = 1.5 },
63                presets.wipeitalics          { },
64                {
65                    tweak = "checkaccents",
66                },
67                {
68                    tweak = "kerns",
69                    list  = {
70                        [0x002F]                = { topleft  = -0.15, bottomright = -0.15 },
71                        ["0x7D.parts.top"]      = { topright = -0.15,                     }, -- right brace top
72                        ["0x7D.parts.bottom"]   = {                   bottomright = -0.15 }, -- right brace bottom
73                        ["0x7D.variants.*"]     = { topright = -0.05, bottomright = -0.05 }, -- right brace variants
74                        ["0x29.parts.top"]      = { topright = -0.1,                      }, -- right parenthesis top
75                        ["0x29.parts.bottom"]   = {                   bottomright = -0.1  }, -- right parenthesis bottom
76                        ["0x29.variants.*"]     = { topright = -0.1,  bottomright = -0.1  }, -- right parenthesis variants
77                        ["0x221A.parts.top"]    = { topright =  0.2,                      }, -- right radical top
78                        ["0x221A.parts.bottom"] = {                   bottomright =  0.2  }, -- right radical bottom
79                        ["0x221A.variants.*"]   = { topright =  0.2,  bottomright =  0.2  }, -- right radical variants
80                        [0x27E9]                = { topright = -0.1,  bottomright = -0.1  }, -- angle
81                        ["0x27E9.variants.*"]   = { topright = -0.2,  bottomright = -0.2  },
82                        [0x27EB]                = { topright = -0.1,  bottomright = -0.1  },
83                        ["0x27EB.variants.*"]   = { topright = -0.2,  bottomright = -0.2  },
84                        [0x00393]               = {                   bottomright = -0.3  }, -- upright Gamma
85                    },
86                },
87                {
88                    tweak = "flattenaccents",
89                },
90                {
91                    tweak   = "radicaldegreeanchors",
92                    list = {
93                        ["0x221A.parts.bottom"] = { location = "left", hfactor  = .1, vfactor  = 1.025 },
94                    }
95                },
96                {
97                    tweak = "checkspacing",
98                },
99                {
100                    tweak = "addscripts",
101                },
102                {
103                    tweak = "accentdimensions",
104                },
105                {
106                    tweak = "addrules",
107                },
108{
109    tweak    = "replacerules",
110    -- minus = {
111    --     height      = 0.188,
112    --     yoffset     = 0.812,
113    --     leftoffset  = 0.2,
114    --     rightoffset = 0.2,
115    -- },
116    fraction = {
117        height  = .188,
118        yoffset = .812,
119    },
120    radical = {
121        height      = .188,
122        yoffset     = .812,
123        leftoffset  = 0.12,
124        rightoffset = 0.12,
125    },
126    stacker = {
127        height  = .188,
128        yoffset = .812,
129    },
130},
131                {
132                    tweak = "addactuarian",
133                },
134                {
135                    tweak = "addequals",
136                },
137                {
138                    tweak = "addfourier",
139                    variant = 2,
140                },
141                {
142                    tweak = "addprimed",
143                },
144                {
145                    tweak = "setoptions",
146                },
147            },
148        },
149        bigslots = {
150            1, 2, 3, 4
151        },
152    },
153
154}
155