1
2
3
4
5
6
7
8
9
10local function fix_italic(target,original,name,value,factor)
11 local m = target.parameters.mathsize
12 if m then
13 local u = type(name) == "number" and name or original.resources.unicodes[name]
14 if u then
15 local c = target.characters[u]
16 if c then
17 local i = c.italic
18 if i then
19 local d = original.descriptions[u]
20 if d and d.math.italic == value then
21 if m then
22 logs.report("patching font","fixing italic correction of %U at math size %i by %0.3f",u,m,factor)
23 c.italic = factor * i
24 end
25 end
26 end
27 end
28 end
29 end
30end
31
32return {
33 name = "stix-two-math",
34 version = "1.00",
35 comment = "Goodies that complement stix two opentype.",
36 author = "Hans Hagen",
37 copyright = "ConTeXt development team",
38 mathematics = {
39
40 alternates = {
41 calligraphic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Calligraphic Characters" },
42 italic = { feature = 'ss02', value = 1, comment = "Mathematical Alternative Lowercase Italic" },
43 barred = { feature = 'ss03', value = 1, comment = "Mathematical Alternative Barred Characters" },
44 primes = { feature = 'ss04', value = 1, comment = "Mathematical Alternative Primes" },
45 arrow = { feature = 'ss05', value = 1, comment = "Mathematical Alternative Smaller Arrows" },
46 narrower = { feature = 'ss06', value = 1, comment = "Mathematical Alternative Narrower Elements" },
47 small = { feature = 'ss07', value = 1, comment = "Mathematical Alternative Smaller Operators" },
48 upright = { feature = 'ss08', value = 1, comment = "Mathematical Alternative Upright Symbols" },
49 negated = { feature = 'ss09', value = 1, comment = "Mathematical Alternative Negated Symbols" },
50 relation = { feature = 'ss10', value = 1, comment = "Mathematical Alternative Relations" },
51 negatedset = { feature = 'ss09', value = 1, comment = "Mathematical Alternative Negated Set Symbols" },
52
53 circled = { feature = 'ss16', value = 1, comment = "Mathematical Alternative Circled Operators" },
54 },
55 tweaks = {
56 aftercopying = {
57 function(target,original)
58 fix_italic(target,original,"uni222B.updsp",80,3.5)
59 fix_italic(target,original,"uni222B.up", 80,2.5)
60 end,
61 },
62 },
63 },
64}
65
66
67 |