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

Appearance settings

Better document font.<generic-family> rcParams entries. #18683

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Oct 7, 2020

Because DejaVu is shipped with Matplotlib, searching font.serif will
never go beyond the first item (DejaVu Serif), and likewise for
font.sans-serif and font.monospace. So delete the entries which are
clearly never used. (If someone really wants to strip the fonts in a
custom distribution of Matplotlib, and not provide DejaVu separately,
they'll have to adapt the list as desired -- they already need to fix
the last-resort fallback to DejaVu in font_manager.py anyways.)

Also reword the description of font.family.

PR Summary

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and pydocstyle<4 and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@QuLogic
Copy link
Member

QuLogic commented Oct 7, 2020

Hmm, I dunno, this maybe works as a bit of documentation of alternatives.

@anntzer
Copy link
Contributor Author

anntzer commented Oct 7, 2020

I think improving the prose is more useful? In practice I would guess for 99% of the people who really want to set these they'll set it to a single value anyways...

matplotlibrc.template Outdated Show resolved Hide resolved
matplotlibrc.template Outdated Show resolved Hide resolved
matplotlibrc.template Outdated Show resolved Hide resolved
@tacaswell
Copy link
Member

I'm in favor of adding the generic class back to the list so if something catastrophic does happen, we at least try to fallback to the correct class of font before we hit DejaVu serif, 👍 to this going in either way though.

@tacaswell tacaswell added this to the v3.4.0 milestone Oct 14, 2020
@anntzer
Copy link
Contributor Author

anntzer commented Oct 14, 2020

But that last fallback can never actually succeed, right? (At least I don't have a font whose family name is just "serif" or just "monospace".) Or can it?

@tacaswell
Copy link
Member

🐑 your right font family is something we invented, not a thing that the fonts report about them selves.

@QuLogic
Copy link
Member

QuLogic commented Oct 14, 2020

serif and the others are meta-fonts, which are accepted by fontconfig, and return a default font for the type & glyph. Perhaps they had more use when USE_FONTCONFIG could be enabled?

Copy link
Member

@jklymak jklymak 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 actually 👎 on this change. I've, in the past, uncommented this line and re-ordered it just to see the changes. If you remove the list folks don't know what other options there are. I appreciate that these may not be always available, etc, but still, I think the list is useful.

Comment on lines 215 to 216
## for when rendering text with usetex), or one of the following five generic
## values:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
## for when rendering text with usetex), or one of the following five generic
## values:
## when rendering text with usetex), or one of the following five generic
## values:

@anntzer
Copy link
Contributor Author

anntzer commented Feb 1, 2021

fair point re: documentation usefulness. I restored the old value and reworded the surrounding doc (and commit message) accordingly.

@anntzer anntzer changed the title Remove never used font family fallbacks. Better document font.<generic-family> rcParams entries. Feb 1, 2021
@timhoffm timhoffm merged commit 4078b8a into matplotlib:master Feb 1, 2021
@anntzer anntzer deleted the fontrc branch February 1, 2021 21:40
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.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.