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

Add os.PathLike support to FT2Font constructor, and FontManager by QuLogic · Pull Request #30573 · matplotlib/matplotlib · GitHub

Repository navigation

Add os.PathLike support to FT2Font constructor, and FontManager - #30573

Merged
tacaswell merged 1 commit into
matplotlib:text-overhaulfrom
QuLogic:font-pathlike
Sep 25, 2025
Merged

tacaswell merged 1 commit into
matplotlib:text-overhaulfrom
QuLogic:font-pathlike

Conversation

QuLogic commented Sep 17, 2025

Copy link
Copy Markdown
Member

PR summary

Since we pass the filename to io.open, we can accept everything it can.

Also, fix the return value of FT2Font.fname, which could be bytes if that was initially provided.

I extracted this out of #30334 since it's independent

PR checklist

QuLogic added this to the v3.11.0 milestone Sep 17, 2025
github-project-automation Bot moved this to Waiting for other PR in Font and text overhaul Sep 17, 2025
QuLogic moved this from Waiting for other PR to Ready for Review in Font and text overhaul Sep 17, 2025
Since we pass the filename to `io.open`, we can accept everything it
can.

Also, fix the return value of `FT2Font.fname`, which could be `bytes` if
that was initially provided.
with pytest.raises(FileNotFoundError):
get_font(bytes(tmp_path / 'non-existent-font-name.ttf'))

# Not really public, but get_font doesn't expose non-filename constructor.

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

note to future reviewers, this was removed as redundent with other test

tacaswell merged commit 1b3ba17 into matplotlib:text-overhaul Sep 25, 2025
37 checks passed
github-project-automation Bot moved this from Ready for Review to Done in Font and text overhaul Sep 25, 2025
QuLogic deleted the font-pathlike branch September 25, 2025 18:15
wavebyrd pushed a commit to wavebyrd/matplotlib that referenced this pull request Mar 13, 2026
Add os.PathLike support to FT2Font constructor, and FontManager
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

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL