Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Deprecate passing Type1Font effects as dict#15896
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
Deprecate passing Type1Font effects as dict#15896
Uh oh!
There was an error while loading.Please reload this page.
Conversation
77a6dee
to75ed591
Compare75ed591
to572e4eb
CompareThere 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.
Actually I think the old API makes sense,effects
is really just a lightweight object/namedtuple. If you track the callers you will see that ultimatelyeffects
comes from reading pdftex.map, which contain entries speficying font slant and extend, which always come as a single pair, not as separate things.
Then the usage example athttps://matplotlib.org/api/type1font.html#module-matplotlib.type1font is misleading because it's not actual a use case? It explicitly creates single-item tuples and passes them to the function. |
Sorry, I guess my comment was slightly misleading. The entries in pdftex.map don't necessarily specify both sland and extend, the idea is more that the two of them (or only one of them, if only one of them exists) are carried together as a dict through multiple functions and it doesn't make sense to split them at the last minute. |
Will decide later if I want to follow up on this. |
at least the (independent) docstring cleanups are fine by themselves. |
(I guess one could introduce a namedtuple to represent the slant/extend pair, but that feels a bit overengineered to me -- there's some level at which dicts are just fine...) |
Not going to fight over this. |
PR Summary
https://matplotlib.org/devdocs/api/type1font.html#matplotlib.type1font.Type1Font.transform has a peculiar API of passing two optional parameters as dict.
This PR deprecates that behavior and instead introduces two regular keyword arguments with default values.
PR Checklist