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

Do not remove serif font family in pgf example to avoid Warning#20945

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

Conversation

FranzForstmayr
Copy link

Currently the pgf_plots example throws a warning that the pgf font serif is not found.
This PR fixes this behaviour.

Fixes#20850

PR Summary

PR Checklist

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (runflake8 on changed files to check).
  • [N/A] New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • Conforms to Matplotlib style conventions (installflake8-docstrings and runflake8 --docstring-convention=all).
  • [N/A] New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping@matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

Copy link
Contributor

@aitikguptaaitikgupta left a comment

Choose a reason for hiding this comment

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

I'm not sure why there's no "Check the rendered docs here!" GitHub Action check for this PR.. but this looks good, thanks!

@QuLogic
Copy link
Member

Because Circle hasn't run a doc CI build at all.

aitikgupta reacted with thumbs up emoji

@aitikgupta
Copy link
Contributor

aitikgupta commentedAug 31, 2021
edited
Loading

There seems to be a separate bug; that the Cursive font-family isn't found by CI:
https://63196-1385122-gh.circle-artifacts.com/0/doc/build/html/gallery/userdemo/pgf_fonts.html

This is true for other PRs too (for example, the most recent#20949):
https://63199-1385122-gh.circle-artifacts.com/0/doc/build/html/gallery/userdemo/pgf_fonts.html

Though It did use to find thecursive font-family for the previous builds (on stable):https://matplotlib.org/stable/gallery/userdemo/pgf_fonts.html

@QuLogic
Copy link
Member

/stable/ is built on my machine, not CI. You can't compare it to/devdocs/ or PR builds.

@QuLogic
Copy link
Member

It appears that we use Comic (Neue, Sans MS) because it's already listed infont.cursive, but it's not available on CI. Felipa is also listed in that font list, and is explicitly installed on CI, so maybe we should switch to that instead?

aitikgupta reacted with thumbs up emoji

@anntzer
Copy link
Contributor

As discussed during the dev call this is actually hiding a bug that I bisected back to#10339; the fix is clear looking at that PR, and should be something like

diff --git i/lib/matplotlib/backends/backend_pgf.py w/lib/matplotlib/backends/backend_pgf.pyindex 749da55966..8706fed514 100644--- i/lib/matplotlib/backends/backend_pgf.py+++ w/lib/matplotlib/backends/backend_pgf.py@@ -50,9 +50,14 @@ def get_fontspec():         for family, command in zip(families, commands):             # 1) Forward slashes also work on Windows, so don't mess with             # backslashes.  2) The dirname needs to include a separator.-            path = pathlib.Path(fm.findfont(family))-            latex_fontspec.append(r"\%s{%s}[Path=\detokenize{%s}]" % (-                command, path.name, path.parent.as_posix() + "/"))+            try:+                path = pathlib.Path(+                    fm.findfont(family, fallback_to_default=False))+            except ValueError:+                pass+            else:+                latex_fontspec.append(r"\%s{%s}[Path=\detokenize{%s}]" % (+                    command, path.name, path.parent.as_posix() + "/"))      return "\n".join(latex_fontspec)

Copy link
Contributor

@anntzeranntzer left a comment

Choose a reason for hiding this comment

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

Per the above.

@jklymak
Copy link
Member

I'm moving to draft until the above is addressed. Thanks!

@jklymakjklymak marked this pull request as draftSeptember 21, 2021 12:43
@FranzForstmayrFranzForstmayr marked this pull request as ready for reviewSeptember 22, 2021 08:18
@anntzer
Copy link
Contributor

I think this just needs the change to the example to be reverted, but otherwise looks good.

@anntzeranntzer removed their request for reviewSeptember 23, 2021 08:17
@FranzForstmayr
Copy link
Author

Reverting the change does not seem to work.
https://63832-1385122-gh.circle-artifacts.com/0/doc/build/html/gallery/userdemo/pgf_fonts.html

I can remove the empty list from the font specification again, otherwise I'm not sure how to fix this error.

@anntzer
Copy link
Contributor

Actually there's another problem with the example, which is that it doesn't actulaly use the pgf backend (which is a pity...)
One needs to add e.g.backend="pgf" to each of the savefig calls.
That then shows another problem with the example, which is thatfamily="cursive" doesn't work, which Iguess could just be documented as a limitation of backend_pgf (because TeX has\rmfamily \sffamily \ttfamily but no\cursivefamily (or\calfamily, I guess).

@jklymakjklymak marked this pull request as draftOctober 5, 2021 07:44
@jklymak
Copy link
Member

I popped this back to draft, but feel free to put back on the queue

@tacaswelltacaswell modified the milestones:v3.5.0,v3.6.0Oct 13, 2021
@tacaswell
Copy link
Member

tacaswell commentedOct 20, 2021
edited by QuLogic
Loading

@FranzForstmayr Can you squash this into one commit so we do not have the commit and it's reversion in the history? You can do this withgit rebase -i. Please ask if you need help!

Do not remove serif font family in pgf example to avoid WarningAdd requested changesRevert "Fixmatplotlib#20850"This reverts commit0bff071.
@QuLogic
Copy link
Member

Hmm,@FranzForstmayr did you intend to close this?

@FranzForstmayr
Copy link
Author

Yes, as there is a more recent PR (#22111) about this topic.

@QuLogicQuLogic removed this from thev3.6.0 milestoneSep 9, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer requested changes

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

@aitikguptaaitikguptaaitikgupta approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[Bug]: Warning: Font Family not found
6 participants
@FranzForstmayr@QuLogic@aitikgupta@anntzer@jklymak@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp