-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
If we are going to go through and re-generate a lot of test images it should be coupled with an audit of if that image actually needs text in it and switching them to the new defaults.
Originally posted by @tacaswell in #16447
Currently the layout managers main job is to avoid overwriting text between subplots on a page. They currently use image tests to check that this works, and those image tests change a fair bit if kerning or glyphs change in the font management.
I think most, if not all, of these tests could be changed to replace the text with shapes. Maybe even automatically - eg instead of "remove text" we have "shapify-text", where it gets a nominal text size from rcParams and makes a nominal shape in the correct spot of the correct, but nominal, size. eg it does not use the actual size of any text elements as rendered, but says its 12-pt font, x characters, so we make a box that is 14 points by 13*x points large centered where the label should go. If these tests were made deterministic this way, then they could even possibly drop the image tests and just test the position of the axes, which is what the layout engines do.