Skip to content

Commit be920a5

Browse files
mdboomQuLogic
authored andcommitted
Stabilize mathtext baseline
1 parent 00d5cb6 commit be920a5

File tree

711 files changed

+4
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

711 files changed

+4
-1
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ def to_raster(self, *, antialiased: bool) -> RasterParse:
157157

158158
for ox, oy, info in shifted.glyphs:
159159
info.font.draw_glyph_to_bitmap(
160-
image, int(ox), int(oy - info.metrics.iceberg), info.glyph,
160+
image,
161+
int(ox),
162+
int(oy - np.ceil(info.metrics.iceberg)),
163+
info.glyph,
161164
antialiased=antialiased)
162165
for x1, y1, x2, y2 in shifted.rects:
163166
height = max(int(y2 - y1) - 1, 0)
19 Bytes
14 Bytes
9 Bytes
11 Bytes
13 Bytes
11 Bytes
9 Bytes
-9 Bytes
-120 Bytes

0 commit comments

Comments
 (0)