Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Make PyFT2Font a subclass of FT2Font#30324

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 2 commits intomatplotlib:text-overhaulfromQuLogic:ft2font-subcless
Aug 7, 2025

Conversation

@QuLogic
Copy link
Member

@QuLogicQuLogic commentedJul 17, 2025
edited
Loading

PR summary

This avoids a level of indirection, and also means that aFT2Font is aPyFT2Font (since there are no other subclasses), which helps with some future work. The only downside is that the constructor/destructor order is fixed and slightly different, so we need to split the open/close stages for theFT_Face and explicitly call them inPyFT2Font.

There are currentlystill two copies of the fallback list, one on each level. The one onFT2Font is what's actually used, but the one onPyFT2Font is the actual owner (because pybind11 owns the objects, so we need a Python object to own them). I think it may be possible to drop that extra copy by switching tostd::shared_ptr, but that will likely require the smart holders that are new in pybind11 v3, and I haven't fully tested that out yet.

This PR is based on/waiting for#30322.

PR checklist

@QuLogic
Copy link
MemberAuthor

The goal here is to avoid having to this wholeset_parent thing:https://github.com/matplotlib/matplotlib/pull/30000/files#diff-c8ef50e596f5bb461a98e5c60d0061276d773c260b206290ee71c63817242c08R174-R183 for which we have to mapFT_Face ->FT2Font ->PyFT2Font but with this PR, the latter two are the same.

@github-actionsgithub-actionsbot removed topic: rcparams Documentation: user guidefiles in galleries/users_explain or doc/users labelsJul 24, 2025
@QuLogicQuLogic marked this pull request as ready for reviewJuly 24, 2025 19:06
@QuLogicQuLogic moved this fromWaiting for other PR toReady for Review inFont and text overhaulJul 24, 2025
Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

Modulo clarifying a comment and moving two parts of the codes closer together again.

@timhoffm
Copy link
Member

Modulo clarifying the possibly duplicate close#30324 (review)

Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

@QuLogic can self-merge when CI passes again.

@QuLogicQuLogic merged commitdb17baf intomatplotlib:text-overhaulAug 7, 2025
35 of 37 checks passed
@github-project-automationgithub-project-automationbot moved this fromReady for Review toDone inFont and text overhaulAug 7, 2025
@QuLogicQuLogic deleted the ft2font-subcless branchAugust 7, 2025 21:18
QuLogic added a commit to QuLogic/matplotlib that referenced this pull requestAug 21, 2025
I thought this was because this branch was missingd2d969e, but it was actually a changeintroduced inmatplotlib#30324 as a separate (but similar-looking) issue.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tacaswelltacaswelltacaswell approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees

No one assigned

Projects

Status: Done

Milestone

v3.11.0

Development

Successfully merging this pull request may close these issues.

3 participants

@QuLogic@timhoffm@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp