FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Pass explicit font paths to fontspec in backend_pgf. by anntzer · Pull Request #10339 · matplotlib/matplotlib · GitHub

Repository navigation

Pass explicit font paths to fontspec in backend_pgf. - #10339

Merged
timhoffm merged 1 commit into
matplotlib:masterfrom
anntzer:pgf-fontspec
May 6, 2018
Merged

timhoffm merged 1 commit into
matplotlib:masterfrom
anntzer:pgf-fontspec

Conversation

anntzer commented Jan 28, 2018

Copy link
Copy Markdown
Contributor

PR Summary

xref #10307. @laborleben Can you check whether this works for you? Seems better than continuously posting patches :)

Basically

  1. we already have a font fonding mechanism and should just reuse it in backend_pgf.
  2. we sometimes find fonts in nonstandard locations and may need to tell tex exactly where to find them.

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 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

Copy link
Copy Markdown

Hi, thanks a lot for the work. This time it worked like a charm. I tried different parameters and the code worked every time. I'm looking forward to see your improvements merged upstream.

If you need further testing on macOS, please let me know.

anntzer added this to the v2.2 milestone Jan 29, 2018

jklymak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This seems fine to me, and glad it fixes the pdf issue...

anntzer modified the milestones: needs sorting, v3.0 Feb 17, 2018
anntzer force-pushed the pgf-fontspec branch 2 times, most recently from 4dc3ed1 to b002924 Compare May 3, 2018 02:50
Comment thread lib/matplotlib/backends/backend_pgf.py Outdated
# backslashes. 2) The dirname needs to include a separator.
dirname = Path(fm.findfont(family)).parent.as_posix() + "/"
latex_fontspec.append(
r"\%s{%s}[Path=%s]" % (command, basename, dirname))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

basename seems undefined. Apparently an untested code path 😦

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

oops, fixed

"""Build fontspec preamble from rc."""
latex_fontspec = []
texcommand = get_texcommand()
texcommand = rcParams["pgf.texsystem"]

timhoffm May 6, 2018 •
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Do we explicitly not want the check and fallback mechanism to xelatex, which was implemented in get_texcommand?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That does already get checked during standard rcparam validation.

timhoffm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Conditional on CI.

Bonus points if you want to add a test for the pgf.rcfonts code path.

anntzer commented May 6, 2018

Copy link
Copy Markdown
Contributor Author

I'll skip the bonus points.

timhoffm merged commit bdeb21e into matplotlib:master May 6, 2018
anntzer deleted the pgf-fontspec branch May 6, 2018 21:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL