CachingFontDriver
A caching implementation of FontDriver that wraps another driver to avoid loading the same face repeatedly.
CachingFontDriver keeps one base face per fileOrUrl, data: urls are kept by their SHA-256 digest, so the cache does not hold the font data in them. Every call to loadFace returns a new face obtained through Face.withSize on the base face, which shares the font data with it. Each returned face is owned by the caller and can be closed independently; the shared font data is freed once the base face and all faces derived from it are closed.
Properties
Functions
Load a face at DEFAULT_SIZE_IN_POINTS, use Face.withSize to obtain the face at other sizes
Load a face at DEFAULT_SIZE_IN_POINTS without blocking, drivers that load fonts asynchronously, like in browsers, override this