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

Fix glyph sizing in textpath.#14159

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

Closed
anntzer wants to merge1 commit intomatplotlib:mainfromanntzer:fontsize

Conversation

anntzer
Copy link
Contributor

@anntzeranntzer commentedMay 7, 2019
edited
Loading

PR Summary

Scaling by dvifont.size / self.FONT_SCALE resulted in way to small
glyphs for many fonts.

Closes the "bad size" part of#12928 /#14146 (comment).
This goes on top of#14156 even though they are technically independent as both are needed to fix (I think)#14156.

Setting the later scaling of 1 should be equivalent (modulo hinting, which is likely better?) to the solution in#12928 (comment), which increased the font size to compensate for the later scaling.

Closes#8068.

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

mpl.rcParams['svg.fonttype'] = 'none'
# Use Computer Modern Sans Serif, not Helvetica (which has no \textwon).
mpl.style.use('default')
plt.figtext(.5, .5, r'\textdegree', usetex=True)
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

(I intentionally chose this character with a simple outline to make the svg as small as possible :))

Scaling by dvifont.size / self.FONT_SCALE resulted in way to smallglyphs for many fonts.
@timhoffm
Copy link
Member

I don't see a clear effect, but that's also becausedvifont.size / self.FONT_SCALE = 99.6 / 100 on my system. Can I resonably modify them to check that one should actually use 1 and not this ratio?

Also, is it correct that

size=fontsize/self.FONT_SCALE
still uses the ratio?

@anntzer
Copy link
ContributorAuthor

Hum, looks like this depends on some details of your tex install, in particular I can't repro this anymore "as is" with texlive 2019; OTOH one can still see the issue with

import matplotlib.pyplot as pltplt.rcParams['text.usetex'] = Trueplt.figure().text(.5, .5, r'\LARGE ff\textwon')  # force LARGE fontplt.savefig('/tmp/plot.svg')plt.show()

but this shows that even setting the size to 1 is not sufficient to fix the problem (even though it does improve the situation).

@tacaswelltacaswell modified the milestones:v3.2.0,v3.3.0Aug 28, 2019
@QuLogicQuLogic modified the milestones:v3.3.0,v3.4.0May 2, 2020
@QuLogicQuLogic modified the milestones:v3.4.0,v3.5.0Jan 21, 2021
@jklymakjklymak marked this pull request as draftApril 23, 2021 16:35
@QuLogicQuLogic modified the milestones:v3.5.0,v3.6.0Aug 23, 2021
@timhoffmtimhoffm modified the milestones:v3.6.0,unassignedApr 30, 2022
@story645story645 modified the milestones:unassigned,needs sortingOct 6, 2022
@github-actions
Copy link

Since this Pull Request has not been updated in 60 days, it has been marked "inactive." This does not mean that it will be closed, though it may be moved to a "Draft" state. This helps maintainers prioritize their reviewing efforts. You can pick the PR back up anytime - please ping us if you need a review or guidance to move the PR forward! If you do not plan on continuing the work, please let us know so that we can either find someone to take the PR over, or close it.

@QuLogic
Copy link
Member

Replaced by#30100

@anntzeranntzer deleted the fontsize branchMay 28, 2025 06:32
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
future releases
Development

Successfully merging this pull request may close these issues.

svg backend has limited encoding support with usetex
5 participants
@anntzer@timhoffm@QuLogic@tacaswell@story645

[8]ページ先頭

©2009-2025 Movatter.jp