1
2
3
4local patches = fonts.handlers.otf.enhancers.patches
5
6local function patch(data,filename,threshold)
7 local m = data.metadata.math
8 if m then
9 local d = m.DisplayOperatorMinHeight or 0
10 if d < threshold then
11 patches.report("DisplayOperatorMinHeight(%s -> %s)",d,threshold)
12 m.DisplayOperatorMinHeight = threshold
13 end
14 end
15end
16
17patches.register("after","analyze math","asana",function(data,filename) patch(data,filename,1350) end)
18
19local function less(value,target,original)
20
21 return 0.25 * value
22end
23
24local function more(value,target,original)
25 local o = original.mathparameters.DisplayOperatorMinHeight
26 if o < 2800 then
27 return 2800 * target.parameters.factor
28 else
29 return value
30 end
31end
32
33
34return {
35 name = "asana-math",
36 version = "1.00",
37 comment = "Goodies that complement asana.",
38 author = "Hans Hagen",
39 copyright = "ConTeXt development team",
40 mathematics = {
41 parameters = {
42
43
44
45
46
47
48
49
50
51
52
53 StackBottomDisplayStyleShiftDown = less,
54 StackBottomShiftDown = less,
55 StackDisplayStyleGapMin = less,
56 StackGapMin = less,
57 StackTopDisplayStyleShiftUp = less,
58 StackTopShiftUp = less,
59 StretchStackBottomShiftDown = less,
60 StretchStackGapAboveMin = less,
61 StretchStackGapBelowMin = less,
62 StretchStackTopShiftUp = less,
63 }
64 }
65}
66
67 |