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 machinery for png-only, single-font mathtext tests.#19261
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
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
horizontalalignment='center', verticalalignment='center') | ||
font_tests = list(filter(lambda x: x[1] is not None, enumerate(font_tests))) |
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 think this filtering should stay right below the definition offont_tests
, because it's only a helper to sanetize the list (namely, to skip deleted tests).
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 added another commit (actually, a first commit) to factor out test skipping for all ofmathtext_rendering
,mathtext_rendering_lightweight
, andmathfont_rendering
.
Just pytest.skip()ping them in the baseline_images fixture will avoidhaving to duplicate the logic in the upcoming png-only tests.
(For the sqrt test added below, each font adds ~2k to the size of thebaseline image file.)
86f97b2
to7f7fad9
Compare@@ -114,6 +114,7 @@ | |||
# default) and only png outputs, in order to minimize the size of baseline | |||
# images. | |||
lightweight_math_tests = [ | |||
r'$\sqrt[ab]{123}$', # github issue #8665 |
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.
What's up with theab
alignment? It doesn't appear to follow the baseline to me, but align to top instead.
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.
This only appears with text.hinting = "none" (which is used by tests, but is not the default otherwise). I suspect this is just one of the vertical alignments problems mentioned in#5414.
Also manually testing with a large text size (e.g. 48) allows verifying that there is no top-alignment.
ednl commentedJan 31, 2021
Thanks for doing this. Can't wait for it to be released, mainly for "noninteger bases in mathtext sqrt" which I ran in to recently. |
Alternate for#19201. png turns out to be heavier than svg-without-font embedding, but if we stick to a single font it's cheaper that testing all 5 fonts in svg. (For the sqrt test added below, each font adds ~2k to the size of the baseline image file.)
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).