summaryrefslogtreecommitdiff
path: root/tex/context/fonts/mkiv/antykwa-math.lfg
blob: 975ada70e11d256e5654e5896fb42e83bc657848 (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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
-- no longer ok for mkiv: digits are not antykwa

local fraction = .25

local badones = {
    summationtext         = fraction,
    producttext           = fraction,
    integraltext          = fraction,
    uniontext             = fraction,
    intersectiontext      = fraction,
    unionmultitext        = fraction,
    logicalandtext        = fraction,
    logicalortext         = fraction,
    summationdisplay      = fraction,
    productdisplay        = fraction,
    integraldisplay       = fraction,
    uniondisplay          = fraction,
    intersectiondisplay   = fraction,
    unionmultidisplay     = fraction,
    logicalanddisplay     = fraction,
    logicalordisplay      = fraction,
    coproducttext         = fraction,
    coproductdisplay      = fraction,

    braceleftBig          = fraction,
    braceleftBigg         = fraction,
    braceleftbig          = fraction,
    braceleftbigg         = fraction,
    parenleftBig          = fraction,
    parenleftBigg         = fraction,
    parenleftbig          = fraction,
    parenleftbigg         = fraction,
    bracketleftBig        = fraction,
    bracketleftBigg       = fraction,
    bracketleftbig        = fraction,
    bracketleftbigg       = fraction,
    ceilingleftBig        = fraction,
    ceilingleftBigg       = fraction,
    ceilingleftbig        = fraction,
    ceilingleftbigg       = fraction,
    floorleftBig          = fraction,
    floorleftBigg         = fraction,
    floorleftbig          = fraction,
    floorleftbigg         = fraction,
    anglebracketleftBig   = fraction,
    anglebracketleftBigg  = fraction,
    anglebracketleftbig   = fraction,
    anglebracketleftbigg  = fraction,

    bracerightBig         = fraction,
    bracerightBigg        = fraction,
    bracerightbig         = fraction,
    bracerightbigg        = fraction,
    parenrightBig         = fraction,
    parenrightBigg        = fraction,
    parenrightbig         = fraction,
    parenrightbigg        = fraction,
    bracketrightBig       = fraction,
    bracketrightBigg      = fraction,
    bracketrightbig       = fraction,
    bracketrightbigg      = fraction,
    ceilingrightBig       = fraction,
    ceilingrightBigg      = fraction,
    ceilingrightbig       = fraction,
    ceilingrightbigg      = fraction,
    floorrightBig         = fraction,
    floorrightBigg        = fraction,
    floorrightbig         = fraction,
    floorrightbigg        = fraction,
    anglebracketrightBig  = fraction,
    anglebracketrightBigg = fraction,
    anglebracketrightbig  = fraction,
    anglebracketrightbigg = fraction,

    backslashBig          = fraction,
    backslashBigg         = fraction,
    backslashbig          = fraction,
    backslashbigg         = fraction,
}

local uglyones = {
    braceleft     = true,
    braceright    = true,
    vextendsingle = true,
    vextenddouble = true,
}

local recipes = {
    ["antykwa-math"] = {
        { name = "file:LatinModern-Math", features = "virtualmath-antykwa", main = true, parameters = false },
        --
        { name = "rm-anttr.tfm",  vector = "tex-mr", skewchar=0x7F },
        { name = "mi-anttri.tfm", vector = "tex-mi", skewchar=0x7F },
        { name = "mi-anttri.tfm", vector = "tex-it", skewchar=0x7F },
        { name = "mi-anttbi.tfm", vector = "tex-bi", skewchar=0x7F },
        { name = "rm-anttb.tfm",  vector = "tex-bf", skewchar=0x7F },
        { name = "sy-anttrz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true
        { name = "sy-anttrz.tfm", vector = "extensible-jmn-private", skewchar=0x30 },
        { name = "file:AntykwaTorunska-Regular", vector = "tex-ex-braces", backmap = false },
        { name = "ex-anttr.tfm",  vector = "tex-ex", extension = true, badones = badones, ignore = uglyones },
    },
    ["antykwa-light-math"] = {
        { name = "file:LatinModern-Math", features = "virtualmath-antykwa-light", main = true, parameters = false },
        --
        { name = "rm-anttl.tfm",  vector = "tex-mr", skewchar=0x7F },
        { name = "mi-anttli.tfm", vector = "tex-mi", skewchar=0x7F },
        { name = "mi-anttli.tfm", vector = "tex-it", skewchar=0x7F },
        { name = "mi-anttri.tfm", vector = "tex-bi", skewchar=0x7F },
        { name = "rm-anttr.tfm",  vector = "tex-bf", skewchar=0x7F },
        { name = "sy-anttlz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true
        { name = "sy-anttlz.tfm", vector = "extensible-jmn-private", skewchar=0x30 },
        { name = "file:AntykwaTorunskaLight-Regular", vector = "tex-ex-braces", backmap = false },
        { name = "ex-anttl.tfm",  vector = "tex-ex", extension = true, badones = badones, ignore = uglyones },
    },
    ["antykwa-cond-math"] = {
        { name = "file:LatinModern-Math", features = "virtualmath-antykwa-cond", main = true, parameters = false },
        --
        { name = "rm-anttcr.tfm",  vector = "tex-mr", skewchar=0x7F },
        { name = "mi-anttcri.tfm", vector = "tex-mi", skewchar=0x7F },
        { name = "mi-anttcri.tfm", vector = "tex-it", skewchar=0x7F },
        { name = "mi-anttcbi.tfm", vector = "tex-bi", skewchar=0x7F },
        { name = "rm-anttcb.tfm",  vector = "tex-bf", skewchar=0x7F },
        { name = "sy-anttcrz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true
        { name = "sy-anttcrz.tfm", vector = "extensible-jmn-private", skewchar=0x30 },
        { name = "file:AntykwaTorunskaCond-Regular", vector = "tex-ex-braces", backmap = false },
        { name = "ex-anttcr.tfm",  vector = "tex-ex", extension = true, badones = badones, ignore = uglyones },
    },
    ["antykwa-light-cond-math"] = {
        { name = "file:LatinModern-Math", features = "virtualmath-antykwa-lightcond", main = true, parameters = false },
        --
        { name = "rm-anttcl.tfm",  vector = "tex-mr", skewchar=0x7F },
        { name = "mi-anttcli.tfm", vector = "tex-mi", skewchar=0x7F },
        { name = "mi-anttcli.tfm", vector = "tex-it", skewchar=0x7F },
        { name = "mi-anttcri.tfm", vector = "tex-bi", skewchar=0x7F },
        { name = "rm-anttcr.tfm",  vector = "tex-bf", skewchar=0x7F },
        { name = "sy-anttclz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true
        { name = "sy-anttclz.tfm", vector = "extensible-jmn-private", skewchar=0x30 },
        { name = "file:AntykwaTorunskaCondLight-Regular", vector = "tex-ex-braces", backmap = false },
        { name = "ex-anttcl.tfm",  vector = "tex-ex", extension = true, badones = badones, ignore = uglyones },
    },
}

local tweaks = nil
local common = fonts.goodies.load("common-math-jmn.lfg")

if common then

    tweaks = {
        {
            tweak  = "addmissing",
            action = common.mathematics.helpers.addmissing,
        },
        {
            tweak = "setoptions",
            set   = { "ignorekerndimensions" }
        }, -- we have dp > ht fences
        {
            tweak  = "fixprimes",
            factor = 1.0, -- accent base height
            fake   = 0.9, -- replace multiples with this width proportion
        },
        {
            tweak = "addequals",
            force = true,
        },
        {
            tweak = "keepbases",
--             list  = { 0x302 }
            list  = "default"
        },
}

    common.mathematics.helpers.copyrecipes(recipes)

end

return {
    name = "antykwa-math",
    version = "1.00",
    comment = "Goodies that complement antykwa math.",
    author = "Hans, Mojca, Aditya, Mikael",
    copyright = "ConTeXt development team",
    mathematics = {
        mapfiles = {
            "antt-rm.map",
            "antt-mi.map",
            "antt-sy.map",
            "antt-ex.map",
         -- "mkiv-base.map",
        },
        variables = {
            notshiftfactor = 0.075,
        },
        virtuals = {
            ["antykwa-math"]               = { recipe = recipes["antykwa-math"],            tweaks = tweaks },
            ["antykwa-light-math"]         = { recipe = recipes["antykwa-light-math"],      tweaks = tweaks },
            ["antykwa-cond-math"]          = { recipe = recipes["antykwa-cond-math"],       tweaks = tweaks },
            ["antykwa-light-cond-math"]    = { recipe = recipes["antykwa-light-cond-math"], tweaks = tweaks },

            ["antykwa-math-nt"]            = common and { recipe = recipes["antykwa-math-nt"]            } or nil,
            ["antykwa-light-math-nt"]      = common and { recipe = recipes["antykwa-light-math-nt"]      } or nil,
            ["antykwa-cond-math-nt"]       = common and { recipe = recipes["antykwa-cond-math-nt"]       } or nil,
            ["antykwa-light-cond-math-nt"] = common and { recipe = recipes["antykwa-light-cond-math-nt"] } or nil,
        },
    }
}