GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Implement Font-Fallback in Matplotlib by aitikgupta · Pull Request #20740 · matplotlib/matplotlib Conversation
|
|
To actually trigger this workflow, I'll push similar commits similar to #20549.. Also, there's a lot of print/debug statements throughout, I'll remove them once this moves ahead.. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
9aee34b to
9fabbc7
Compare
There was an error while loading. Please reload this page.
|
EDIT: I've merged the FT2Font changes together for both PRs |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
0fa0625 to
e868fbc
Compare
f7ee09b to
37c51b1
Compare
On Linux and Mac. Add a font_manager test that loads the font and uses it. This could be useful in testing the multi-font support (matplotlib#20740 etc). I couldn't get the font installed on Windows. There is a Chocolatey installer that installs all of the Noto fonts, which takes a really long time to run.
|
@aitikgupta Do these have a review team looking at them? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@jklymak I don't think anybody is actively reviewing these font handling PRs at the moment.. but they're ready for review and not drafts (I'll resolve the conflicts) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Going ahead and removing the test, since font distributions for different Linux versions across CI are different.. and thus their kerning information is different -- different visual outputs. We can test it with a self-shipped CJK font, which is guaranteed to be present across all platforms.. but that'd be another problem because their file sizes are huge. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
(Unfortunately, I will not have the bandwidth to review this in the coming days.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Hi @aitikgupta we were all discussing this PR yesterday - did you have an opportunity to rebase and address the review comments? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey @jklymak, I'm currently out sick. Will get back to this as soon as I can, probably a week or two. Apologies! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
No rush, get better! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey @QuLogic, addressed all the comments (added comments for further discussions), and brought the PR up to speed! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
3d6c81e to
02b569a
Compare
There was an error while loading. Please reload this page.
|
The general design looks reasonable and a skim through the actual implementation only revealed the small issues listed above, which should be fixed, but once that's done I am happy with merging this as is and iterating over it later. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The new code is 2-space indent instead of 4. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
30e47af to
c62b2e5
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| Get the `.FT2Font` for *font_prop*, clear its buffer, and set its size. | ||
| """ | ||
| font = get_font(findfont(font_prop)) | ||
| fname = find_fonts_by_props(font_prop) |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fname should be renamed to filename_dict or at least filenames (plural) for clarity.
Given that get_font only uses .values(), I would suggest making it clearer at this stage too (filenames = list(find_fonts_by_props(font_prop).values()); font = get_font(filenames)) (and modify get_font to take a list instead of a dict). This would also make it easier for third-parties to directly call get_font with a list of font paths rather having to invent keys to create a dict, if they don't already have a dict at hand.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I do not remember why we used a dictionary instead of a list
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
As a meta comment, this seems like a pretty big change to squeeze in right before a 3.6 release, versus getting it in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Talking about that: what is the time line? I sort of expected 3.5.3 to be released "soon" and then probably a few months until 3.6? (Really OT, but still...) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Fair, however you do not pass a list of fallbacks then there should be no behavior change, we hammer these code paths in the tests, and I do not think of the core devs do enough mixed glyph work (I could be wrong about that) to meaning stress it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
An additional point I just thought about: the actual low-level API (including passing a list of fallback FT2Font to the FT2Font constructor) should probably be marked as provisional. While I haven't actually checked, I believe that the current API may be slightly inefficient, because (if I understood it correctly) we will always immediately parse all font files (a costly operation) in the fallback list, regardless of whether we actually need them or not, whereas we could imagine an API where we only store a list of fallback paths that get parsed one at a time when needed. (This is also relevant for mplcairo, which doesn't use FT2Font at all and simply gets the paths of the fonts to do its own interfacing with freetype.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
That will require documenting |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I wasn't actually asking for FT2Font to be documented (a blurb in the changelog without linking API entries would have worked too), but sure, that's always a good thing to add. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should be good, though needs the rebase for added/removed files.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Aitik Gupta <[email protected]> Co-authored-by: Elliott Sales de Andrade <[email protected]>
14251eb to
85bacdc
Compare
|
Squashed this all to 1 commit: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you @aitikgupta ! This would not have been possible without your work. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Super glad this finally made it! Thanks everyone for pushing this 🙇🏼♂️ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Matplotlib would not try to apply all the font in font list to draw all characters in the given string.
There was an error while loading. Please reload this page.