-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Various cleanups to pgf backend. #20466
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Should probably get a note that __init__
wraps this with a per-instance-cache.
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.
done
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.
Other than the existing comments.
- Replace _font_properties_str by _escape_and_apply_props, which handles all the preprocessing needed before sending a str to tex. (This means that LatexManager.get_text_width_height_descent now additionally handles unescaped strings as well, too.) - Replace str_cache by a (per-instance) lru_cache. - When querying tex for a string's metrics, send both `\sbox` and `\typeout` in a single go, which saves one cycle of waiting for the interactive prompt.
all the preprocessing needed before sending a str to tex. (This means
that LatexManager.get_text_width_height_descent now additionally
handles unescaped strings as well, too.)
\sbox
and\typeout
in a single go, which saves one cycle of waiting for theinteractive prompt.
PR Summary
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).