Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
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
def __init__(self, filename: str | os.PathLike) -> None: ... | ||
def get_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
to3f2c7dd
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.
Just one suggestion to make the dataclass keyword argument only
Uh oh!
There was an error while loading.Please reload this page.
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.
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 :) |
Pushed a commit that fixes it locally. Look like this is a limitation in stubtests that does not correctly handle the |
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? |
I've got a minimal reproducer, will post an issue upstream |
Thanks :) |
002661c
intomatplotlib:mainUh oh!
There was an error while loading.Please reload this page.
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