Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support for vector hrule rendering#26337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
devRD wants to merge2 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromdevRD:mt-hrulerender
Draft
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletionslib/matplotlib/_mathtext.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -98,8 +98,9 @@ def __init__(self, box):
self.rects = [] # (x1, y1, x2, y2)

def to_vector(self):
w, h, d = map(
np.ceil, [self.box.width, self.box.height, self.box.depth])
w = self.box.width
h = self.box.height
d = self.box.depth
gs = [(info.font, info.fontsize, info.num, ox, h - oy + info.offset)
for ox, oy, info in self.glyphs]
rs = [(x1, h - y2, x2 - x1, y2 - y1)
Expand All@@ -116,11 +117,12 @@ def to_raster(self, antialiased=None):
xmax = max([*[ox + info.metrics.xmax for ox, oy, info in self.glyphs],
*[x2 for x1, y1, x2, y2 in self.rects], 0]) + 1
ymax = max([*[oy - info.metrics.ymin for ox, oy, info in self.glyphs],
*[y2 for x1, y1, x2, y2 in self.rects], 0]) + 1
w = xmax - xmin
*[y2 for x1, y1, x2, y2 in self.rects], 0]) + 1.5

w = self.box.width
h = ymax - ymin - self.box.depth
d = ymax - ymin - self.box.height
image = FT2Image(np.ceil(w), np.ceil(h + max(d, 0)))
image = FT2Image(w,h + max(d, 0))

# Ideally, we could just use self.glyphs and self.rects here, shifting
# their coordinates by (-xmin, -ymin), but this yields slightly
Expand DownExpand Up@@ -2449,7 +2451,6 @@ def _genfrac(self, ldelim, rdelim, rule, style, num, den):
cnum.hpack(width, 'exactly')
cden.hpack(width, 'exactly')
vlist = Vlist([cnum, # numerator
Vbox(0, thickness * 2.0), # space
Hrule(state, rule), # rule
Vbox(0, thickness * 2.0), # space
cden # denominator
Expand All@@ -2462,7 +2463,7 @@ def _genfrac(self, ldelim, rdelim, rule, style, num, den):
'=', state.fontsize, state.dpi)
shift = (cden.height -
((metrics.ymax + metrics.ymin) / 2 -
thickness *3.0))
thickness *1.5))
vlist.shift_amount = shift

result = [Hlist([vlist, Hbox(thickness * 2.)])]
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp