enable icon indicating copy to clipboard operation
enable copied to clipboard

Add a function which triggers creation/refresh of the Kiva font cache

Open jwiggins opened this issue 4 years ago • 2 comments

Warming up the Kiva font cache is a very expensive operation (several seconds). Most code will only trigger it when drawing text, which is generally gives a bad user experience.

We should instead provide a function in the public API which triggers creation of the cache if it is not yet built. Currently kiva.fonttools.font_manager.default_font_manager does this as a side-effect, but it is not part of the public API. I don't think it should become public, but I do think another function should exist for managing the cache.

jwiggins avatar May 24 '21 08:05 jwiggins

IMO, default_font_manager() is the correct API to call for this purpose. The cache is an implementation detail. What I care about ensuring (greedily, at startup) is that the font manager is initialized.

rkern avatar May 26 '21 03:05 rkern

OK, but the font manager itself is a hidden implementation detail. The public interface is the Font class. Are you saying we shouldn't provide a new function with a nice name that makes sure the font manager is initialized?

jwiggins avatar May 26 '21 09:05 jwiggins