erewhon-math.lfg /size: 6158 b    last modification: 2024-01-16 10:22
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 = "dimensions",
42                    list  = {
43                        ["0x222B.variants.*"] = { axis = .15 },
44                    },
45                },
46                {
47                    tweak = "fixintegrals",
48                },
49                presets.scripttocalligraphic { },
50                presets.rsfstoscript         { },
51                presets.rsfsuprighttoscript  { },
52                presets.moderntocalligraphic { },
53                presets.eulertocalligraphic  { },
54                presets.xitsarabic           { rscale  = 0.90 },
55                presets.fallbacks            { },
56                presets.moveitalics          { correct = true },
57                presets.moveitalics          { correct = true, letters = true },
58                presets.moveintegrals        { factor = 1.5 },
59                presets.wipeitalics          { },
60                {
61                    tweak = "checkaccents",
62                },
63                {
64                    tweak = "kerns",
65                    list  = {
66                        [0x002F]                = { topleft  = -0.15, bottomright = -0.15 },
67                        ["0x7D.parts.top"]      = { topright = -0.15,                     }, -- right brace top
68                        ["0x7D.parts.bottom"]   = {                   bottomright = -0.15 }, -- right brace bottom
69                        ["0x7D.variants.*"]     = { topright = -0.05, bottomright = -0.05 }, -- right brace variants
70                        ["0x29.parts.top"]      = { topright = -0.1,                      }, -- right parenthesis top
71                        ["0x29.parts.bottom"]   = {                   bottomright = -0.1  }, -- right parenthesis bottom
72                        ["0x29.variants.*"]     = { topright = -0.1,  bottomright = -0.1  }, -- right parenthesis variants
73                        ["0x221A.parts.top"]    = { topright =  0.2,                      }, -- right radical top
74                        ["0x221A.parts.bottom"] = {                   bottomright =  0.2  }, -- right radical bottom
75                        ["0x221A.variants.*"]   = { topright =  0.2,  bottomright =  0.2  }, -- right radical variants
76                        [0x27E9]                = { topright = -0.1,  bottomright = -0.1  }, -- angle
77                        ["0x27E9.variants.*"]   = { topright = -0.2,  bottomright = -0.2  },
78                        [0x27EB]                = { topright = -0.1,  bottomright = -0.1  },
79                        ["0x27EB.variants.*"]   = { topright = -0.2,  bottomright = -0.2  },
80                        [0x00393]               = {                   bottomright = -0.3  }, -- upright Gamma
81                    },
82                },
83                {
84                    tweak = "flattenaccents",
85                },
86                {
87                    tweak   = "radicaldegreeanchors",
88                    list = {
89                        ["0x221A.parts.bottom"] = { location = "left", hfactor  = .1, vfactor  = 1.025 },
90                    }
91                },
92                {
93                    tweak = "checkspacing",
94                },
95                {
96                    tweak = "addscripts",
97                },
98                {
99                    tweak = "accentdimensions",
100                },
101                {
102                    tweak = "addrules",
103                },
104{
105    tweak    = "replacerules",
106    -- minus = {
107    --     height      = 0.188,
108    --     yoffset     = 0.812,
109    --     leftoffset  = 0.2,
110    --     rightoffset = 0.2,
111    -- },
112    fraction = {
113        height  = .188,
114        yoffset = .812,
115    },
116    radical = {
117        height      = .188,
118        yoffset     = .812,
119        leftoffset  = 0.12,
120        rightoffset = 0.12,
121    },
122    stacker = {
123        height  = .188,
124        yoffset = .812,
125    },
126},
127                {
128                    tweak = "addactuarian",
129                },
130                {
131                    tweak = "addequals",
132                },
133                {
134                    tweak = "addfourier",
135                    variant = 2,
136                },
137                {
138                    tweak = "addprimed",
139                },
140                {
141                    tweak = "setoptions",
142                },
143            },
144        },
145        bigslots = {
146            1, 2, 3, 4
147        },
148    },
149
150}
151