xcharter-math.lfg /size: 5706 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 = "xcharter-math",
9    version = "1.00",
10    comment = "Goodies that complement xcharter math.",
11    author = "Hans Hagen & Mikael Sundqvist",
12    copyright = "ConTeXt development team",
13    mathematics = {
14        parameters = {
15            DelimiterPercent                  =  85,
16            DelimiterShortfall                = 400,
17            DelimiterDisplayPercent           =  90,
18            DelimiterDisplayShortfall         = 400,
19            SubscriptShiftDown                = 200, -- 300 in font
20            SubscriptShiftDownWithSuperscript = "1.3*SubscriptShiftDown", -- 1.5* in math-act
21            PrimeShiftUp                      = "1.2*SuperscriptShiftUp",
22            PrimeShiftUpCramped               = "1.2*SuperscriptShiftUp",
23            PrimeBaselineDropMax              = "0.5*SuperscriptBaselineDropMax",
24            RadicalDisplayStyleVerticalGap    = "RadicalVerticalGap", --178, 73
25        },
26        tweaks = {
27            aftercopying = {
28                {
29                    tweak   = "fixprimes",
30                    factor  = 0.92,
31                },
32                {
33                    tweak = "addmirrors",
34                },
35                presets.scripttocalligraphic { },
36                presets.rsfstoscript         { },
37                presets.rsfsuprighttoscript  { },
38                presets.moderntocalligraphic { },
39                presets.eulertocalligraphic  { },
40                presets.xitsarabic           { rscale  = 0.90 },
41                presets.fallbacks            { },
42                presets.moveitalics          { correct = true },
43                presets.moveitalics          { correct = true, letters = true },
44                presets.moveintegrals        { factor = 1.5 },
45                presets.wipeitalics          { },
46                {
47                    tweak = "checkaccents",
48                },
49                {
50                    tweak = "kerns",
51                    list  = {
52                        [0x002F]                = { topleft  = -0.15, bottomright = -0.15 },
53                        ["0x7D.parts.top"]      = { topright = -0.15,                     }, -- right brace top
54                        ["0x7D.parts.bottom"]   = {                   bottomright = -0.15 }, -- right brace bottom
55                        ["0x7D.variants.*"]     = { topright = -0.05, bottomright = -0.05 }, -- right brace variants
56                        ["0x29.parts.top"]      = { topright = -0.1,                      }, -- right parenthesis top
57                        ["0x29.parts.bottom"]   = {                   bottomright = -0.1  }, -- right parenthesis bottom
58                        ["0x29.variants.*"]     = { topright = -0.1,  bottomright = -0.1  }, -- right parenthesis variants
59                        ["0x221A.parts.top"]    = { topright =  0.2,                      }, -- right radical top
60                        ["0x221A.parts.bottom"] = {                   bottomright =  0.2  }, -- right radical bottom
61                        ["0x221A.variants.*"]   = { topright =  0.2,  bottomright =  0.2  }, -- right radical variants
62                        [0x27E9]                = { topright = -0.1,  bottomright = -0.1  }, -- angle
63                        ["0x27E9.variants.*"]   = { topright = -0.2,  bottomright = -0.2  },
64                        [0x27EB]                = { topright = -0.1,  bottomright = -0.1  },
65                        ["0x27EB.variants.*"]   = { topright = -0.2,  bottomright = -0.2  },
66                        --
67                        [0x00393] = { bottomright = -0.20, }, -- upright Gamma
68                    },
69                },
70                {
71                    tweak   = "radicaldegreeanchors",
72                    list = {
73                        ["0x221A.parts.bottom"] = { location = "left", hfactor  = .1, vfactor  = 1.025 },
74                    }
75                },
76                {
77                    tweak = "flattenaccents",
78                },
79                {
80                    tweak = "checkspacing",
81                },
82                {
83                    tweak = "addscripts",
84                },
85                {
86                    tweak = "accentdimensions",
87                },
88                {
89                    tweak = "addrules",
90                },
91{
92    tweak    = "replacerules",
93    -- minus = {
94    --     height      = 0.188,
95    --     yoffset     = 0.812,
96    --     leftoffset  = 0.2,
97        -- rightoffset = 0.2,
98    -- },
99    fraction = {
100        height  = .188,
101        yoffset = .812,
102    },
103    radical = {
104        height      = .188,
105        yoffset     = .812,
106        leftoffset  = 0.95,
107        rightoffset = 0.95,
108        -- leftoverlap = 0.1, -- Daniel will fix(!)
109        -- yscale      = 0.8, -- no scaling
110    },
111    stacker = {
112        height  = .188,
113        yoffset = .812,
114    },
115},
116                {
117                    tweak = "addactuarian",
118                },
119                {
120                    tweak = "addequals",
121                },
122                {
123                    tweak = "addprimed",
124                },
125-- {
126--     tweak = "addarrows",
127-- },
128                {
129                    tweak = "addfourier",
130                    variant = 2,
131                },
132                {
133                    tweak = "setoptions",
134                    -- set   = { "ignorekerndimensions" }
135                },
136            },
137        },
138        bigslots = {
139            1, 2, 3, 4
140        },
141    },
142
143}
144