| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| .. plot:: | ||
|
|
||
| import matplotlib.pyplot as plt | ||
|
|
||
| # Use old kerning values: | ||
| plt.rcParams['text.kerning_factor'] = 6 | ||
| fig, ax = plt.subplots() | ||
| ax.text(0.0, 0.05, 'BRAVO\nAWKWARD\nVAT\nW.Test', fontsize=56) | ||
| ax.set_title('Before (text.kerning_factor = 6)') | ||
|
|
||
| Note how the spacing between characters is uniform between their bounding boxes |
There was a problem hiding this comment.
I decided to remove this plot from the old what's new, as it will no longer show any difference between it and the plot below (with the correct results) once we switch to libraqm, and so it might be misleading.
Sorry, something went wrong.
|
|
||
| def test_ft2font_set_size(): | ||
| file = fm.findfont('DejaVu Sans') | ||
| font = ft2font.FT2Font(file, hinting_factor=1, _kerning_factor=1) |
There was a problem hiding this comment.
This being 1 seems to have been a typo. Since the test checks relative results, it made no difference here.
Sorry, something went wrong.
|
The rcParams depreciation machinery was removed per #29563. But you can still dreprecate rcParams if you want to
|
Sorry, something went wrong.
|
OK, I've added a deprecation for the rcParam directly, then. |
Sorry, something went wrong.
This factor existed only to preserve test images, but as of matplotlib#29816, it is set to 0 (i.e., disabled and providing default behaviour). In the future, with libraqm, it will have no effect no matter its setting (because we won't be applying kerning ourselves at all.)
| Back | FazBrowse Home | New Git URL |
PR summary
This factor existed only to preserve test images, but as of #29816, it is set to 0 (i.e., disabled and providing default behaviour). In the future, with libraqm, it will have no effect no matter its setting (because we won't be applying kerning ourselves at all.)
Since we seem to have removed most of the rcParam deprecation machinery, instead of warning from there, warn from the FT2Font constructor, which is always passed _kerning_factor in the normal code path (i.e., anywhere outside of direct tests.) This does mean the warning won't occur directly where you set it, nor if you don't use any text, but I think that's a reasonable compromise.
PR checklist