Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Don't set a default size for FT2Font#30319
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
Conversation
In the interest of handling non-scalable fonts and reducing fontinitialization, drop the default size from the `FT2Font` constructor.Non-scalable fonts are sometimes used for bitmap-backed emoji fonts.When we start supporting collection fonts (`.ttc`), then setting a sizeis a waste, as we will just need to read the count of fonts within.The renderer method `Renderer.draw_text` always sets a size immediatelyafter creating the font object, so this doesn't affect anything in mostcases. Only the direct `FT2Font` tests need changes.
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.
Emitting a warning would seem quite tedious to do.
Would it make sense to add an optional |
Given that the target consumer of Font objects is the |
7dae1e5
intomatplotlib:text-overhaulUh oh!
There was an error while loading.Please reload this page.
PR summary
In the interest of handling non-scalable fonts and reducing font initialization, drop the default size from the
FT2Font
constructor. Non-scalable fonts are sometimes used for bitmap-backed emoji fonts. When we start supporting collection fonts (.ttc
), then setting a size is a waste, as we will just need to read the count of fonts within.The renderer method
Renderer.draw_text
always sets a size immediately after creating the font object, so this doesn't affect anything in most cases. Only the directFT2Font
tests need changes.I'm only unsure whether we wish to somehow warn/deprecate when this the size isn't set explicitly.
PR checklist