Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Switch Tfm metrics to TrueType-compatible API.#29838
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
lib/matplotlib/dviread.pyi Outdated
| height:dict[int,int] | ||
| depth:dict[int,int] | ||
| def__init__(self,filename:str|os.PathLike)->None: ... | ||
| defget_metrics(self,int)->TexMetrics|None: ... |
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.
| defget_metrics(self,int)->TexMetrics|None: ... | |
| defget_metrics(self,idx:int)->TexMetrics|None: ... |
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.
thanks, fixed
b09d728 to3f2c7ddCompare
dstansby left a comment
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.
Just one suggestion to make the dataclass keyword argument only
Uh oh!
There was an error while loading.Please reload this page.
anntzer commentedMar 31, 2025
sure, done |
Instead of directly exposing widths, heights, depths dicts, provide aget_metrics method to access a glyph's (tex) metrics. This change is inpreparation for {xe,lua}tex support, which would use an alternativemetrics-loading class (`TtfMetrics`) where it would be excessive to loadthe metrics of all glyphs at once.anntzer commentedMar 31, 2025
I'm a bit at loss as to how to placate mypy here, so if someone who actually uses typing could have a look, this would be very helpful :) |
tacaswell commentedMar 31, 2025
Pushed a commit that fixes it locally. Look like this is a limitation in stubtests that does not correctly handle the |
dstansby commentedMar 31, 2025
Looks like it's related to (but not the same as) the fixedpython/mypy#15749. Might be worth a minimal reproducer and a issue report upstream in mypy? |
dstansby commentedMar 31, 2025
I've got a minimal reproducer, will post an issue upstream |
anntzer commentedMar 31, 2025
Thanks :) |
002661c intomatplotlib:mainUh oh!
There was an error while loading.Please reload this page.
tacaswell commentedApr 1, 2025
thank you@dstansby ! |
Another small preparatory PR for#29807 ({xe,lua}tex support).
Instead of directly exposing widths, heights, depths dicts, provide a get_metrics method to access a glyph's (tex) metrics. This change is in preparation for {xe,lua}tex support, which would use an alternative metrics-loading class (
TtfMetrics) where it would be excessive to load the metrics of all glyphs at once.PR summary
PR checklist