GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — mathtext: add mathnormal and distinguish between normal and italic family by llohse · Pull Request #31121 · matplotlib/matplotlib Conversation
|
|
Thanks for your comments.
Will do. I did not add tests yet, because a lot of tests where failing with the text-overaul branch at the time.
I got them from https://ctan.org/tex-archive/fonts/cm/ps-type1/bakoma. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@QuLogic it looks like the tests are still failing with the text-overhaul branch here. Do you know a workaround? It is a bit difficult to pinpoint the tests that I need to update, when everything fails. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
3b4303a to
cd3eb9a
Compare
|
It's a bit complicated; you would have to fetch from the If you do update the test images yourself, please keep it as a separate commit so that it can be stripped before merging. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks a lot. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The branches should be in sync again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Taking a quick look at the results, I see in There does seem to be something wrong with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thanks for testing. Previously, the BakomaFonts class would force all digits (no matter what font was selected) to
That said, some other tests still fail here, like mathtext_cm_00. The letters are displayed upright instead of italic in mathnormal mode. There seems to be a logic bug in the other classes. I'll do some debugging. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This is likely due to an outdated local font cache, which does not include cmti10. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
82f1cc6 to
16fe453
Compare
|
I fixed all of the regressions that I could find. There are still a large number of the computer modern tests failing, which I cannot quite put my finger on. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Ah right, I forgot it doesn't update for the internal fonts. You can bump the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Some of the remaining test failures with Computer Modern seem to come from metrics being measured on cmti instead of cmmi. One example is |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
The tests succeed now against the baseline images from QuLogic's branch, except for those few cases that are expected to fail due to the changed behaviour. The previous failures were caused by the slanted attribute not being set correctly for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
78d80c0 to
2016c6e
Compare
|
I have updated the announcement to be more vocal about the changed behaviour of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Some tests would be nice (you can maybe use check_figures_equal to compare a mathnormal string and the corresponding mixture of mathrm & mathit, not so much to save a few baseline images but more importantly because that would actually test the semantics of mathnormal). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Both 'normal' (via default math) and 'it' are already covered by the existing tests. A test for explicit Note that we cannot compare mathnormal with mathit even for letters, because they can be different fonts/alphabets (for example in the case of computer modern). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Replace lookup table for font constants based on the family name by methods in their respective classes. Removes non-local call of private _get_font method in _get_font_constant_set. This simplifies implementing dynamically loaded font constants.
|
I have just rebased the branch against text-overhaul and resolved the merge conflicts due to #31110 being merged. Is there anything else that needs doing? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
You need to do this when adding new internal fonts. After clearing the cache, I see 14 test changes. For Computer Modern, we get |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks for your feedback!
Done.
I expect these 14. stixsans: Unfortunately, sans-serif italic digits are not defined as unicode symbols (see https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols#Digits) nor in Stix 1. So we have to fall back to sans-serif upright here. A general remark: Combining two environments such as mathbf + mathsf is unique to the hard-coded Stix implementation and is realized via |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Preferably, you could squash the FontManager bump into the commit that adds the new fonts as well.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
To replicate LaTeX behaviour, distinguish between "italic" and "normal" math. In particular, digits should be set italic in the \mathit env. For `cm`, use cmti font for "it" For general UnicodeFont (stix, DejaVu, ...), maps digits to roman or italic alphabet, depending on "normal" or "it" environment.
Ensure that \mathnormal is parsed and sets digits upright.
There was an error while loading. Please reload this page.
mathtext: add mathnormal and distinguish between normal and italic family
This includes images changes for the following pull requests / commits: * [Fix center of rotation with rotation_mode='anchor'](matplotlib#29199) (c44db77) * [Remove ttconv backwards-compatibility code](matplotlib#30145) (8caff88) * [Remove kerning_factor from tests](matplotlib#29816) (7b4d725) * [Set text hinting to defaults](matplotlib#29816) (8255ae2) * [Update FreeType to 2.13.3](matplotlib#29816) (89c054d) * [Implement text shaping with libraqm](matplotlib#30000) (b0ded3a, 9813523) * [Add language parameter to Text objects](matplotlib#29794) (7ce8eae) * [Fix auto-sized glyphs with BaKoMa fonts](matplotlib#29936) (3ba2c13) * [pdf: Improve text with characters outside embedded font limits](matplotlib#30512) (b70fb88, 6cedcf7) * [Prepare `CharacterTracker` for advanced font features](matplotlib#30608) (8274e17, 70dc388, df670cf, ed5e074) * [Add font feature API to Text](matplotlib#29695) (972a688) * [Fix spacing in r"$\max f$"](matplotlib#30715) (4a99a83) * [Implement libraqm for vector outputs](matplotlib#30607) (bd17cd4) * [Drop the FT2Font intermediate buffer](matplotlib#30059) (9d7d7b4) * [Rasterize dvi files without dvipng](matplotlib#30039) (7627118) * [Update bundled FreeType and HarfBuzz libraries](matplotlib#30938) (a161658, 9619bcc) * [Fix positioning of wide mathtext accents](matplotlib#31069) (c2fa7ba) * [Refactor RendererAgg.draw_{mathtext,text,tex} to use same base algorithm](matplotlib#31085) (931bcf3) * [Implement TeX's fraction and script alignment](matplotlib#31046) (94ff452, 4bfa0f9, 1cd8510) * [Fix confusion between text height and ascent in metrics calculations](matplotlib#31107) (60f2310) * [mathtext: Fetch quad width & axis height from font metrics](matplotlib#31110) (692df3f, 383028b) * [mathtext: add mathnormal and distinguish between normal and italic family](matplotlib#31121) (a6913f3) * [ENH: Ignore empty text for tightbbox](matplotlib#31285) (d772043) * [Drop axis_artist tickdir image compat, due to text-overhaul merge](matplotlib#31281) (2057583) * [text: Use font metrics to determine line heights](matplotlib#31291) (3ab6a27, d961462, 97f4943) * [ps/pdf: Override font height metrics to support AFM files](matplotlib#31371) (e0913d4) * [TST: Cleanup back-compat code in tests touched by text overhaul](matplotlib#31295) (7c33379) * [TST: Set tests touched by text overhaul to mpl20 style](matplotlib#31300) (41c4d8d)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[Bug]: Numbers in words not italic
There was an error while loading. Please reload this page.