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

Commit576cd64

Browse files
committed
Fix glyph sizing in textpath.
Scaling by dvifont.size / self.FONT_SCALE resulted in way to smallglyphs for many fonts.
1 parent4833962 commit576cd64

File tree

3 files changed

+51
-14
lines changed

3 files changed

+51
-14
lines changed
Lines changed: 45 additions & 0 deletions
Loading

‎lib/matplotlib/tests/test_backend_svg.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,12 @@ def psfont(*args, **kwargs):
182182
fig.savefig(tmpfile,format='svg')
183183

184184

185-
# Use Computer Modern Sans Serif, not Helvetica (which has no \textwon).
186-
@pytest.mark.style('default')
187185
@needs_usetex
188-
deftest_unicode_won():
189-
fig=Figure()
190-
fig.text(.5,.5,r'\textwon',usetex=True)
191-
192-
withBytesIO()asfd:
193-
fig.savefig(fd,format='svg')
194-
buf=fd.getvalue().decode('ascii')
195-
196-
won_id='Computer_Modern_Sans_Serif-142'
197-
assertre.search(r'<path d=(.|\s)*?id="{0}"/>'.format(won_id),buf)
198-
assertre.search(r'<use[^/>]*? xlink:href="#{0}"/>'.format(won_id),buf)
186+
@image_comparison(baseline_images=['unicode_usetex'],extensions=['svg'])
187+
deftest_unicode_usetex():
188+
mpl.rcParams['svg.fonttype']='none'
189+
mpl.style.use('default')
190+
plt.figtext(.5,.5,r'\textdegree',usetex=True)
199191

200192

201193
deftest_svgnone_with_data_coordinates():

‎lib/matplotlib/textpath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def get_glyphs_tex(self, prop, s, glyph_map=None,
321321
glyph_ids.append(char_id)
322322
xpositions.append(x1)
323323
ypositions.append(y1)
324-
sizes.append(dvifont.size/self.FONT_SCALE)
324+
sizes.append(1)
325325

326326
myrects= []
327327

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp