@@ -98,8 +98,9 @@ def __init__(self, box):
98
98
self .rects = []# (x1, y1, x2, y2)
99
99
100
100
def to_vector (self ):
101
- w ,h ,d = map (
102
- np .ceil , [self .box .width ,self .box .height ,self .box .depth ])
101
+ w = self .box .width
102
+ h = self .box .height
103
+ d = self .box .depth
103
104
gs = [(info .font ,info .fontsize ,info .num ,ox ,h - oy + info .offset )
104
105
for ox ,oy ,info in self .glyphs ]
105
106
rs = [(x1 ,h - y2 ,x2 - x1 ,y2 - y1 )
@@ -116,10 +117,12 @@ def to_raster(self, antialiased=None):
116
117
xmax = max ([* [ox + info .metrics .xmax for ox ,oy ,info in self .glyphs ],
117
118
* [x2 for x1 ,y1 ,x2 ,y2 in self .rects ],0 ])+ 1
118
119
ymax = max ([* [oy - info .metrics .ymin for ox ,oy ,info in self .glyphs ],
119
- * [y2 for x1 ,y1 ,x2 ,y2 in self .rects ],0 ])+ 1
120
- w ,h ,d = map (
121
- np .ceil , [self .box .width ,self .box .height ,self .box .depth ])
122
- image = FT2Image (np .ceil (w ),np .ceil (h + max (d ,0 )))
120
+ * [y2 for x1 ,y1 ,x2 ,y2 in self .rects ],0 ])+ 1.5
121
+
122
+ w = self .box .width
123
+ h = ymax - ymin - self .box .depth
124
+ d = ymax - ymin - self .box .height
125
+ image = FT2Image (w ,h + max (d ,0 ))
123
126
124
127
# Ideally, we could just use self.glyphs and self.rects here, shifting
125
128
# their coordinates by (-xmin, -ymin), but this yields slightly
@@ -2448,7 +2451,6 @@ def _genfrac(self, ldelim, rdelim, rule, style, num, den):
2448
2451
cnum .hpack (width ,'exactly' )
2449
2452
cden .hpack (width ,'exactly' )
2450
2453
vlist = Vlist ([cnum ,# numerator
2451
- Vbox (0 ,thickness * 2.0 ),# space
2452
2454
Hrule (state ,rule ),# rule
2453
2455
Vbox (0 ,thickness * 2.0 ),# space
2454
2456
cden # denominator
@@ -2461,7 +2463,7 @@ def _genfrac(self, ldelim, rdelim, rule, style, num, den):
2461
2463
'=' ,state .fontsize ,state .dpi )
2462
2464
shift = (cden .height -
2463
2465
((metrics .ymax + metrics .ymin )/ 2 -
2464
- thickness * 3.0 ))
2466
+ thickness * 1.5 ))
2465
2467
vlist .shift_amount = shift
2466
2468
2467
2469
result = [Hlist ([vlist ,Hbox (thickness * 2. )])]