Looking for some insights into possible reasons for font differences I am now seeing, and ideas as to what I might do about this.
The back story: I use
matplotlib.testing.compare in my regression tests, comparing test generated images to reference images that were generated a while ago; (see tests here). These comparisons don’t work on every machine, but I’ve got them working well enough that they work fine and catch problems where I do most of my work, and on Travis, which runs these tests every time I enter a Pull Request.
The current story: This week I upgraded my WSL/Ubuntu18 to WSL-2/Ubuntu20. Once I got everything working, I made a fresh clone of my mplfinance repository and ran
pytest. Almost all of the tests failed, but the only differences are slight size and weight difference in the fonts.
Here is an example:
So I am asking to see if anyone has any insights as to how I can find, or verify, which fonts changed, if any, and/or how I can avoid this situation in the future. I would really prefer not to have to go back to WSL (from WSL2). If I have to go back to Ubuntu18 that would be ok, I suppose.
As an additional point, which may or may not be relevant: I did notice the only test images that passed where those in which the font size and weight were NOT specified in rcParams (as they are in most tests). To be extra clear however, although the tests specify a font size and weight in rcParams, these values have NOT changed. The only change was WSL->WSL2 and Ubuntu18->Ubuntu20. I’m just saying that it is possible (perhaps) that specifying the font via rcParams exposes a sensitivity to the difference (gets the font from a different place?).
Does anyone have any suggestions where I should be looking and/or what I should do next to investigate this situation? Thanks for reading and thinking about this. And thanks in advance for any insights you may have! --Daniel