Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Add typing to AFM parser#30134
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
base:main
Are you sure you want to change the base?
Add typing to AFM parser#30134
Conversation
@@ -376,7 +394,8 @@ def get_str_bbox_and_descent(self, s): | |||
except KeyError: | |||
name = 'question' | |||
wx, _, bbox = self._metrics_by_name[name] | |||
total_width += wx + self._kern.get((namelast, name), 0) | |||
total_width += wx |
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.
I'm uncertain ifWX
is the only thing that can be a float, or that's a parsing bug.
Also, |
Also, check some expected conditions at parse time instead of somewhereduring use of the data.
PR summary
Also, check some expected conditions at parse time instead of somewhere during use of the data.
PR checklist