-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Doc] Font Types and Font Subsetting #20450
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
Conversation
EDIT: Updated the link |
This seems helpful. Is this where you decided it belongs? Most other font info is in tutorials, and I think for some of the more technical details we should link out to more definitive resources rather than become bogged down in rewriting the specs for each type of font. I think it would be helpful to give some examples of what type of fonts correspond to what type of downloads (briefly). i.e. some of those fonts are always available (Type 1)? Many are often present on systems (TrueType?) or more commonly downloaded. I appreciate this is complicated, and I don't think you need to go into laborious detail, but I think this guide could be more practical for the end user as opposed to developers. |
Right, so there is one more kind of font that is always available I believe this applies to the 14 PDF core fonts but am not sure what the https://en.wikipedia.org/wiki/PostScript_fonts#Core_Font_Set The downside of using "AFM fonts" is that they cannot be rendered in I believe Type 1 fonts mainly enter the system via usetex/dviread, but
Also present on the system are the old MacOS resource-fork fonts and the A related question that I don't immediately know the answer to is how |
It's still recommended to embed some version of the core fonts if you're using them, and I believe we do. That's toggled by the matplotlib/lib/matplotlib/backends/backend_pdf.py Lines 65 to 69 in c64e8bb
PS doesn't have such a flag, so I'm not sure which way it falls. |
Ah, for PostScript, non-embedding might be triggered by |
Yeah, @tacaswell pointed out we could model it after this user guide. And I think it's at the right place, since all other information around fonts is more on the technical side: "how to use/modify this font with Matplotlib?" vs "okay what does Matplotlib has to do with fonts at all?" |
92e87fc
to
5999170
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks promising. Some in-line comments.
If I was a new user I'd be pretty frustrated by this not telling me how to actually change my font, which is all anyone really wants to know. The context is very useful when things go wrong.
Co-authored-by: Jody Klymak <jklymak@gmail.com>
As discussed on the call, it is easy to find more things to add, but this definitely passes the bar of "is it better than before?". |
PR Summary
A new entry to User Guide - Fonts! (modelled after interactive_guide)
All About Matplotlib and Fonts!
This document would contain everything Matplotlib knows about fonts, and is bootstrapped with the different types of fonts and font subsetting with this PR. This guide would especially be useful for issues related to font subsetting. (for eg., scverse/scanpy#1720)
Also the first time we're mentioning anything about
'fonttypes'
in docs.Related issues: #127
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).