summaryrefslogtreecommitdiff
path: root/tex/context/fonts/mkiv/termes-math.lfg
blob: f45ee4433ed1289e70148a5bd6a743c78253033d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
local dimensions, kerns  if CONTEXTLMTXMODE == 0 then

 -- local kern_V   = { bottomright = { { kern = -200 } } }
 -- local kern_W   = { bottomright = { { kern = -100 } } }
 -- local offset_f = { xoffset = "llx" }
 --
 -- dimensions = {
 --     default = {
 --         [0x1D453] = offset_f, -- 𝑓
 --     },
 -- }
 --
 -- kerns = {
 --     [0x1D449] = kern_V, -- 𝑉
 --     [0x1D44A] = kern_W, -- 𝑊
 -- }

end

-- When set this will bypass the italic correction hackery!
local integral_variants = {  bottomright = -0.20 }
-- local integral_top      = {  topright    =  0.05 }
local integral_bottom   = {  bottomright = -0.30 }


return {
    name = "termes-math",
    version = "1.00",
    comment = "Goodies that complement termes.",
    author = "Hans Hagen & Mikael Sundqvist",
    copyright = "ConTeXt development team",
    mathematics = {
        parameters = {
            NoLimitSupFactor                =    0,
            NoLimitSubFactor                =  900,
         -- AccentBaseHeight                =    0,
            AccentBaseDepth                 =   50,
            RadicalDegreeBottomRaisePercent =   60,
            RadicalRuleThickness            =   46, -- 52 in font 
            DelimiterPercent                =   90,
            DelimiterShortfall              =  400,
            DisplayOperatorMinHeight        = 1800, -- 1300 in font (only one)
            PrimeRaisePercent               =   60, -- 50 default
            PrimeRaiseComposedPercent       =   10, -- 25 default
        },
        tweaks = {
            aftercopying = {
                {
                    tweak    = "version",
                    expected = "Version 1.543",
                },
                {
                    tweak = "dimensions",
                    list  = {
                        [0x1D44F] = { xoffset = 0,     width = 1,    italic = 0,   anchor = 1.3  }, -- b
                        [0x1D451] = { xoffset = 0,     width = 1,    italic = 0,   anchor = 0.8  }, -- d
                        [0x1D452] = { xoffset = 0,     width = 1,    italic = 0,   anchor = 0.9  }, -- e
                        [0x0210E] = { xoffset = 0,     width = 1,    italic = 0,   anchor = 1.3  }, -- h
                        [0x1D458] = { xoffset = 0,     width = 1,    italic = 0,   anchor = 1.3  }, -- k
                        [0x1D453] = { xoffset = 0.6,   width = 1.4,  italic = 1.2, anchor = 1.5  }, -- f
                        [0x1D457] = { xoffset = 0.5,   width = 1.3,  italic = 1.7                }, -- j
                        [0x1D45D] = { xoffset = 0.15,  width = 1.15, italic = 0,   anchor = 1.4  }, -- p
                        [0x1D45E] = { xoffset = 0,     width = 1,    italic = 0,   anchor = 0.9  }, -- q
                        [0x1D464] = { xoffset = 0,     width = 1,    italic = 0,   anchor = 1.1  }, -- w
                        [0x1D6FE] = { xoffset = 0,     width = 1,    italic = 0,   anchor = 1.1  }, -- \gamma
                        [0x1D706] = { xoffset = 0,     width = 1,    italic = 0,   anchor = 1.05 }, -- \lambda
                        [0x1D70A] = { xoffset = 0,     width = 1,    italic = 0,   anchor = 1.2  }, -- \omicron
                        [0x1D70F] = { xoffset = 0,     width = 1,    italic = 0,   anchor = 1.05 }, -- \tau
                    },
                },
                {
                    tweak = "kerns",
                    list  = {
                        [0x2F] = {
                            topleft     = -0.2,
                         -- bottomleft  =  0,
                         -- topright    =  0,
                            bottomright = -0.2,
                       },


                        ["0x7D.parts.top"] = {
                            topright    = -0.15,
                        }, -- right brace top
                        ["0x7D.parts.bottom"] = {
                            bottomright = -0.15,
                        }, -- right brace bottom
                        ["0x7D.variants.*"] = {
                            topright = -0.1,
                            bottomright = -0.1,
                        }, -- right brace variants
                        ["0x29.parts.top"] = {
                            topright    = -0.1,
                        }, -- right parenthesis top
                        ["0x29.parts.bottom"] = {
                            bottomright = -0.1,
                        }, -- right parenthesis bottom
                        ["0x29.variants.*"] = {
                            topright = -0.15,
                            bottomright = -0.15,
                        }, -- right parenthesis variants
                        ["0x221A.parts.top"] = {
                            topright = 0.2,
                        }, -- right radical top
                        ["0x221A.parts.bottom"] = {
                            bottomright = 0.2,
                        }, -- right radical bottom
                        ["0x221A.variants.*"] = {
                            topright = 0.2,
                            bottomright = 0.2,
                        }, -- right radical variants

                        -- angle
                        [0x27E9]              = { topright = -0.1, bottomright = -0.1 },
                        ["0x27E9.variants.*"] = { topright = -0.2, bottomright = -0.2 },
                        [0x27EB]              = { topright = -0.1, bottomright = -0.1 },
                        ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 },

                        ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom,
                        ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom,
                        ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom,
                        ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom,
                        ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom,
                        ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom,
                        ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom,
                        ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom,
                        ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom,



                    },
                },
                {
                    tweak   = "fixprimes",
                    scale   = 0.85,
                 -- smaller = true,
                    factor  = 0.95,
                },
                {
                    tweak = "checkspacing",
                },
                {
                    tweak = "addscripts",
                },
                {
                    tweak = "accentdimensions",
                },
                {
                    tweak = "addrules",
                },
            },
        },
        bigslots = {
            1, 3, 5, 7
        },
        alternates = {
            dotless = { feature = 'dtls', value = 1, comment = "Mathematical Dotless Forms" },
        },
        --
        -- experimental fixes for mkiv:
        --
        dimensions = dimensions,
        kerns = kerns,
    },
}