-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Use json for the font cache instead of pickle #5021
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Do we even have any unit tests for font caching? The problem with Travis here is that the font cache isn't used there at all, I don't think. |
The font cache is always used to draw text, and the test suite draws text. On Travis, the font cache is rebuilt from scratch each time. What we don't have is a test of saving to disk and loading it again. But that should be easy enough to write by calling the various functions in font_manager.py directly from a unit test. |
One problem with testing this class is that it searches the filesystem when you call |
I think it's probably good enough to just save and reload the existing singleton (font_manager.py:fontManager) to a temp file. That shouldn't do a lot of file I/O (other than the tempfile). The generation of the cache itself from the font files on the system is already tested (or at least covered) by the existing unit test suite. |
@jkseppan: Do you consider this ready to merge? Looks good to me. |
I think it should be ready to merge to master, but it's probably too large of a change to add to 1.5.x in the release-candidate phase. |
Yes -- definitely not for 1.5. |
Master is fair game for 2.1 code. |
Use json for the font cache instead of pickle
See discussion at #4756.