The FontCache (née FontLibrary) is a per-task object that knows how to create fonts. It hands out Font objects, which hold native font refs as well as the font file binary.
The font cache should not hand out Font objects; rather, it should hand out FontHandles which lazily cause the loading of fonts, and proxy calls such as measureText. This allows the FontCache to implement any number of caching strategies based on time, number of font requests, etc.
The
FontCache(née FontLibrary) is a per-task object that knows how to create fonts. It hands outFontobjects, which hold native font refs as well as the font file binary.The font cache should not hand out
Fontobjects; rather, it should hand outFontHandles which lazily cause the loading of fonts, and proxy calls such asmeasureText. This allows theFontCacheto implement any number of caching strategies based on time, number of font requests, etc.