1
2
3
4local common = fonts.goodies.load("common-math.lfg")
5local presets = common.mathematics.tweaks.presets
6
7local punctuation = mathematics.tweaks.kernsets[".,"]
8
9return {
10 name = "latin modern math",
11 version = "1.00",
12 comment = "Goodies that complement latin modern math.",
13 author = "Hans Hagen & Mikael Sundqvist",
14 copyright = "ConTeXt development team",
15 mathematics = {
16 parameters = {
17 FractionNumeratorDisplayStyleShiftUp = 600,
18 AccentTopShiftUp = -30,
19 FlattenedAccentTopShiftUp = -30,
20 AccentSuperscriptDrop = 100,
21 AccentSuperscriptPercent = 0,
22 DelimiterPercent = 85,
23 DelimiterShortfall = 400,
24 DelimiterDisplayPercent = 90,
25 DelimiterDisplayShortfall = 400,
26 SubscriptShiftDown = 150,
27 SubscriptShiftDownWithSuperscript = 247,
28
29
30 SuperscriptBaselineDropMax = 0.6*431,
31 SubscriptBaselineDropMin = 0.1*431,
32
33
34 SuperscriptShiftUp = 413,
35 SuperscriptShiftUpCramped = 329,
36 PrimeShiftUp = "1.05*SuperscriptShiftUp",
37 PrimeShiftUpCramped = "1.05*SuperscriptShiftUp",
38
39
40 RadicalDisplayStyleVerticalGap = 120,
41
42 },
43 tweaks = {
44 aftercopying = {
45 {
46 tweak = "version",
47 expected = "Version 1.959",
48 },
49 {
50 tweak = "replacealphabets",
51 list = {
52 {
53
54 filename = "latinmodernmathcompanion-regular.otf",
55 feature = "ss01",
56 unicodes = {
57 0x00028,
58 0x00029,
59 0x0005B,
60 0x0005D,
61 0x027EE,
62 0x027EF,
63 0x02308,
64 0x02309,
65 0x0230A,
66 0x0230B,
67 0x027E6,
68 0x027E7,
69 },
70 },
71 {
72
73 filename = "latinmodernmathcompanion-regular.otf",
74 feature = "ss02",
75 unicodes = {
76 0x0007B,
77 0x0007D,
78 },
79 },
80 {
81 filename = "latinmodernmathcompanion-regular.otf",
82 feature = "ss03",
83 unicodes = {
84 0x0221A,
85 },
86 },
87 {
88
89 filename = "latinmodernmathcompanion-regular.otf",
90 unicodes = {
91 0x0002F,
92
93
94
95 0x0005C,
96
97
98 0x0007C,
99
100 0x02016,
101
102
103
104
105
106
107 0x027E8,
108 0x027E9,
109 0x027EA,
110 0x027EB,
111
112
113 0x02980,
114 },
115 },
116 },
117 },
118 {
119 tweak = "addmirrors",
120 },
121 {
122 tweak = "addcomposites",
123 },
124 presets.scripttocalligraphic { },
125 presets.rsfstoscript { },
126 presets.rsfsuprighttoscript { },
127 presets.moderntocalligraphic { },
128 presets.eulertocalligraphic { },
129 presets.xitsarabic { rscale = 0.80 },
130 presets.fallbacks { },
131 presets.moveitalics { correct = true, letters = true },
132 presets.moveitalics { correct = true, list = mathematics.tweaks.subsets.letterlike },
133 presets.moveintegrals { factor = 1.4, icfactor = 0.8 },
134 presets.wipeanchors { },
135 presets.wipeitalics { },
136 {
137 tweak = "checkaccents",
138 },
139 {
140 tweak = "wipecues",
141 },
142 {
143 tweak = "dimensions",
144 list = {
145 [0x1D487] = { anchor = 0.9 },
146 [0x1D489] = { anchor = 1.2 },
147 [0x1D48C] = { anchor = 1.2 },
148 [0x1D48F] = { anchor = 1.1 },
149 [0x1D491] = { anchor = 1.2 },
150 [0x1D492] = { anchor = 0.9 },
151 [0x1D49B] = { anchor = 0.9 },
152
153 [0x1D736] = { anchor = 0.9 },
154 [0x1D737] = { anchor = 0.9 },
155 [0x1D738] = { anchor = 1.1 },
156 [0x1D740] = { anchor = 1.2 },
157 [0x1D744] = { anchor = 1.2 },
158
159 [0x1D6FE] = { anchor = 1.1 },
160 [0x1D702] = { anchor = 1.1 },
161
162 [0x1D44F] = { anchor = 1.15 },
163 [0x1D451] = { anchor = 0.8, },
164 [0x1D455] = { anchor = 1.15 },
165 [0x1D458] = { anchor = 1.15 },
166 [0x1D45B] = { anchor = 1.1 },
167 [0x1D45D] = { anchor = 1.1 },
168 [0x1D45E] = { anchor = 0.9 },
169 [0x1D467] = { anchor = 0.9 },
170
171 [0x1D6FE] = { anchor = 1.2 },
172 [0x1D706] = { anchor = 1.2 },
173 [0x1D70A] = { anchor = 1.1 },
174 [0x1D70D] = { anchor = 1.1 },
175
176 [0x1D46A] = { anchor = 0.75 },
177 [0x1D46B] = { anchor = 1.1 },
178 [0x1D46E] = { anchor = 0.75 },
179 [0x1D479] = { anchor = 1.2 },
180 [0x1D47A] = { anchor = 0.8 },
181
182 [0x1D435] = { anchor = 1.05 },
183 [0x1D436] = { anchor = 0.7 },
184 [0x1D437] = { anchor = 1.05 },
185 [0x1D43A] = { anchor = 0.8 },
186 [0x1D443] = { anchor = 1.1 },
187 [0x1D445] = { anchor = 1.05 },
188 [0x1D446] = { anchor = 0.85 },
189 [0x1D49C] = { anchor = 0.9 },
190 [0x1D49D] = { anchor = 0.95 },
191 [0x1D49E] = { anchor = 0.8 },
192 [0x1D49F] = { anchor = 0.95 },
193 [0x1D4A0] = { anchor = 0.85 },
194 [0x1D4A1] = { anchor = 0.75 },
195 [0x1D4A2] = { anchor = 0.9 },
196 [0x1D4A3] = { anchor = 0.85 },
197 [0x1D4A4] = { anchor = 0.8 },
198 [0x1D4A5] = { anchor = 0.8 },
199 [0x1D4A6] = { anchor = 0.85 },
200 [0x1D4A7] = { anchor = 0.75 },
201 [0x1D4A8] = { anchor = 0.9 },
202 [0x1D4A9] = { anchor = 0.85 },
203 [0x1D4AA] = { anchor = 0.95 },
204 [0x1D4AB] = { anchor = 0.95 },
205 [0x1D4AC] = { anchor = 0.95 },
206 [0x1D4AD] = { anchor = 0.95 },
207 [0x1D4AE] = { anchor = 0.9 },
208 [0x1D4AF] = { anchor = 0.75 },
209 [0x1D4B0] = { anchor = 0.9, },
210 [0x1D4B1] = { anchor = 0.95 },
211 [0x1D4B2] = { anchor = 0.95 },
212 [0x1D4B3] = { anchor = 0.95 },
213 [0x1D4B4] = { anchor = 0.9 },
214 [0x1D4B5] = { anchor = 1 },
215
216
217
218
219
220
221
222 },
223 },
224 {
225 tweak = "kernpairs",
226 list = {
227
228 [0x1D436] = punctuation[-0.07],
229 [0x1D439] = punctuation[-0.14],
230 [0x1D43B] = punctuation[-0.06],
231 [0x1D43D] = punctuation[-0.17],
232 [0x1D43E] = punctuation[-0.06],
233 [0x1D440] = punctuation[-0.05],
234 [0x1D441] = punctuation[-0.06],
235 [0x1D443] = punctuation[-0.14],
236 [0x1D446] = punctuation[-0.08],
237 [0x1D447] = punctuation[-0.08],
238 [0x1D448] = punctuation[-0.14],
239 [0x1D449] = punctuation[-0.21],
240 [0x1D44A] = punctuation[-0.15],
241 [0x1D44B] = punctuation[-0.06],
242 [0x1D44C] = punctuation[-0.21],
243 [0x1D44D] = punctuation[-0.07],
244 [0x1D451] = {
245 [0x1D44C] = .11,
246 [0x1D449] = -.11,
247 [0x1D453] = -.32,
248 [0x1D453] = -.22,
249 [0x1D457] = -.21,
250 [0x1D457] = -.11,
251 },
252 [0x1D453] = punctuation[-0.09],
253 [0x1D457] = punctuation[-0.12],
254 [0x1D45F] = punctuation[-0.12],
255 [0x00393] = punctuation[-0.15],
256 [0x003A0] = punctuation[-0.06],
257 [0x003A5] = punctuation[-0.15],
258 [0x003A8] = punctuation[-0.08],
259 [0x1D6FF] = punctuation[-0.12],
260 [0x1D708] = punctuation[-0.10],
261 [0x1D70E] = punctuation[-0.09],
262 [0x1D70F] = punctuation[-0.10],
263
264 [0x1D46A] = punctuation[-0.07],
265 [0x1D46D] = punctuation[-0.15],
266 [0x1D46F] = punctuation[-0.06],
267 [0x1D471] = punctuation[-0.17],
268 [0x1D472] = punctuation[-0.06],
269 [0x1D474] = punctuation[-0.05],
270 [0x1D475] = punctuation[-0.06],
271 [0x1D477] = punctuation[-0.14],
272 [0x1D47A] = punctuation[-0.09],
273 [0x1D47B] = punctuation[-0.08],
274 [0x1D47C] = punctuation[-0.14],
275 [0x1D47D] = punctuation[-0.21],
276 [0x1D47E] = punctuation[-0.15],
277 [0x1D47F] = punctuation[-0.06],
278 [0x1D480] = punctuation[-0.21],
279 [0x1D481] = punctuation[-0.08],
280 [0x1D485] = {
281 [0x1D480] = .10,
282 [0x1D481] = -.10,
283 [0x1D487] = -.31,
284 [0x1D48B] = -.21,
285 },
286 [0x1D487] = punctuation[-0.09],
287 [0x1D48B] = punctuation[-0.12],
288 [0x1D493] = punctuation[-0.11],
289 [0x1D6AA] = punctuation[-0.16],
290 [0x1D6B7] = punctuation[-0.06],
291 [0x1D6BC] = punctuation[-0.15],
292 [0x1D6BF] = punctuation[-0.08],
293 [0x1D739] = punctuation[-0.11],
294 [0x1D742] = punctuation[-0.10],
295 [0x1D748] = punctuation[-0.09],
296 [0x1D749] = punctuation[-0.10],
297 },
298 },
299
300
301
302 {
303 tweak = "extendaccents",
304 },
305 {
306 tweak = "flattenaccents",
307 },
308 {
309 tweak = "fixaccents",
310 },
311 {
312 tweak = "radicaldegreeanchors",
313 list = {
314 ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.05 },
315 }
316 },
317 {
318 tweak = "radicalbodymargins",
319 list = {
320
321 ["0x221A.variants.*"] = { left = 0.05 },
322 ["0x221A.variants.1"] = { left = 0 },
323 ["0x221A.variants.2"] = { left = 0 },
324 ["0x221A.variants.3"] = { left = 0 },
325 ["0x221A.variants.4"] = { left = 0 },
326 ["0x221A.variants.5"] = { left = 0 },
327 ["0x221A.variants.6"] = { left = 0.025 },
328 ["0x221A.variants.7"] = { left = 0.025 },
329 ["0x221A.variants.8"] = { left = 0.025 },
330 ["0x221A.variants.9"] = { left = 0.025 },
331 ["0x221A.variants.10"] = { left = 0.025 },
332 ["0x221A.parts.bottom"] = { left = 0.10 },
333 }
334 },
335
336
337
338
339
340
341
342
343
344
345
346
347
348 {
349 tweak = "dimensions",
350 list = {
351 [0x020DB] = { yoffset = -0.015, height = .95, all = true },
352 },
353 },
354
355
356 {
357 tweak = "copyaccents",
358 },
359
360 {
361
362
363
364 tweak = "kerns",
365 list = {
366 [0x0002F] = { topleft = -0.2, bottomright = -0.2 },
367
368 [0x1D49C] = { bottomright = -0.05, },
369 [0x1D49D] = { bottomright = -0.05, },
370 [0x1D49E] = { bottomright = -0.25, },
371 [0x1D49F] = { bottomright = -0.11, },
372 [0x1D4A0] = { bottomright = -0.18, },
373 [0x1D4A1] = { bottomright = -0.30, },
374 [0x1D4A2] = { bottomright = -0.11, },
375 [0x1D4A3] = { bottomright = -0.18, },
376 [0x1D4A4] = { bottomright = -0.25, },
377 [0x1D4A5] = { bottomright = -0.25, },
378 [0x1D4A6] = { bottomright = -0.11, },
379 [0x1D4A7] = { bottomright = -0.05, },
380 [0x1D4A8] = { bottomright = -0.11, },
381 [0x1D4A9] = { bottomright = -0.18, },
382 [0x1D4AA] = { bottomright = -0.05, },
383 [0x1D4AB] = { bottomright = -0.25, },
384 [0x1D4AC] = { bottomright = -0.05, },
385 [0x1D4AD] = { bottomright = -0.05, },
386 [0x1D4AE] = { bottomright = -0.11, },
387 [0x1D4AF] = { bottomright = -0.33, },
388 [0x1D4B0] = { bottomright = -0.11, },
389 [0x1D4B1] = { bottomright = -0.25, },
390 [0x1D4B2] = { bottomright = -0.25, },
391 [0x1D4B3] = { bottomright = -0.11, },
392 [0x1D4B4] = { bottomright = -0.18, },
393 [0x1D4B5] = { bottomright = -0.05, },
394
395 [0x00393] = { bottomright = -0.20, },
396 [0x02207] = { bottomright = -0.20, },
397 [0x1D6C1] = { bottomright = -0.20, },
398 [0x1D6FB] = { bottomright = -0.25, },
399 [0x1D735] = { bottomright = -0.25, },
400
401 ["0x7D.parts.top"] = { topright = -0.25 },
402 ["0x7D.parts.bottom"] = { bottomright = -0.25 },
403 ["0x7D.variants.*"] = { topright = -0.25, bottomright = -0.25 },
404 ["0x29.parts.top"] = { topright = -0.3, },
405 ["0x29.parts.bottom"] = { bottomright = -0.3 },
406 ["0x29.variants.*"] = { topright = -0.15, bottomright = -0.15 },
407 ["0x221A.parts.top"] = { topright = 0.2, },
408 ["0x221A.parts.bottom"] = { bottomright = 0.2 },
409 ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 },
410 [0x27E9] = { topright = -0.2, bottomright = -0.2 },
411 ["0x27E9.variants.*"] = { topright = -0.3, bottomright = -0.3 },
412 [0x27EB] = { topright = -0.2, bottomright = -0.2 },
413 ["0x27EB.variants.*"] = { topright = -0.3, bottomright = -0.3 },
414 },
415 },
416 {
417
418
419 tweak = "margins",
420 list = {
421 [0x1D487] = { left = -.2, right = -.2 },
422 [0x1D489] = { left = -.2, right = -.2 },
423 [0x1D496] = { left = -.1, right = -.1 },
424 [0x1D499] = { left = -.1, right = -.1 },
425
426 [0x1D711] = { left = -.1, right = -.1 },
427 [0x1D713] = { left = -.1, right = -.1 },
428
429 [0x1D659] = { left = -.1, right = -.1 },
430 [0x1D65C] = { left = -.1, right = -.1 },
431
432 [0x1D409] = { left = .1, right = .1 },
433 [0x1D412] = { left = .1, right = .1 },
434
435 [0x1D509] = { left = .1, right = .1 },
436 [0x1D50C] = { left = .1, right = .1 },
437 [0x1D50D] = { left = .1, right = .1 },
438 [0x1D51D] = { left = .1, right = .1 },
439
440 [0x1D538] = { left = .1, right = .1 },
441 [0x1D539] = { left = .1, right = .1 },
442 [0x1D53C] = { left = .1, right = .1 },
443 [0x1D53D] = { left = .1, right = .1 },
444 [0x1D541] = { left = .1, right = .1 },
445 [0x1D542] = { left = .1, right = .1 },
446 [0x1D543] = { left = .1, right = .1 },
447 [0x1D547] = { left = .1, right = .1 },
448 [0x1D549] = { left = .1, right = .1 },
449 [0x1D54A] = { left = .1, right = .1 },
450 [0x1D54B] = { left = .1, right = .1 },
451 [0x1D54D] = { left = .1, right = .1 },
452 [0x1D550] = { left = .1, right = .1 },
453
454 [0x1D506] = { left = .1, right = .1 },
455
456 [0x00393] = { left = .1, right = .1 },
457 [0x00396] = { left = .1, right = .1 },
458
459 [0x1D5D8] = { left = .1, right = .1 },
460 [0x1D5D9] = { left = .1, right = .1 },
461 [0x1D5DF] = { left = .1, right = .1 },
462 [0x1D5E6] = { left = .1, right = .1 },
463
464 [0x1D61A] = { left = .1, right = .1 },
465
466 [0x1D5A2] = { left = .1, right = .1 },
467 [0x1D5A4] = { left = .1, right = .1 },
468 [0x1D5A5] = { left = .1, right = .1 },
469 [0x1D5AF] = { left = .1, right = .1 },
470 [0x1D5B2] = { left = .1, right = .1 },
471 [0x1D5B9] = { left = .1, right = .1 },
472
473 [0x1D4A0] = { left = .1, right = .1 },
474 [0x1D4AE] = { left = .1, right = .1 },
475 [0x1D4B4] = { left = .1, right = .1 },
476
477 [0x0004C] = { left = .1, right = .1 },
478 [0x00053] = { left = .1, right = .1 },
479 [0x0005A] = { left = .1, right = .1 },
480
481 [0x1D43D] = { left = -.1, right = -.1 },
482 [0x1D409] = { left = -.1, right = -.1 },
483 [0x1D471] = { left = -.1, right = -.1 },
484 [0x1D4D9] = { left = -.05, right = -.05 },
485 },
486 },
487 {
488 tweak = "fixprimes",
489 factor = 0.825,
490 },
491 {
492 tweak = "checkspacing",
493 },
494 {
495 tweak = "fixradicals",
496 },
497 {
498 tweak = "addprivates",
499 },
500 {
501 tweak = "addscripts",
502 },
503 {
504 tweak = "accentdimensions",
505 },
506 {
507 tweak = "addrules",
508 },
509 {
510 tweak = "replacerules",
511
512 fraction = { height = .15, yoffset = .85 },
513 radical = { height = .15, yoffset = .85, leftoffset = .065, rightoffset = .065, leftoverlap = 0.023, rightoverlap = 0.023 },
514 stacker = { height = .15, yoffset = .85 },
515 },
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539 {
540 tweak = "addactuarian",
541 },
542
543
544
545
546
547
548
549 {
550 tweak = "addfourier",
551 variant = 1,
552 },
553 {
554 tweak = "addprimed",
555 },
556 {
557 tweak = "addequals",
558 },
559
560 {
561 tweak = "emulatelmtx",
562 feature = "emulatelmtx",
563 comment = "this is for mkiv",
564 },
565
566
567
568
569
570 {
571 tweak = "dimensions",
572 feature = "mathforme",
573 list = {
574 [0x58] = {
575
576 xoffset = 0.5,
577 yoffset = 0.5,
578 },
579 }
580 },
581 },
582 },
583 bigslots = {
584 2, 4, 6, 7
585 },
586 },
587}
588 |