Merge pull request #106 from kortschak/fix-font-cache

Fix unnecessary filesystem access
This commit is contained in:
llgcode 2016-07-12 10:12:54 +02:00 committed by GitHub
commit 13548be874
1 changed files with 4 additions and 0 deletions

View File

@ -120,6 +120,10 @@ type defaultFontCache struct {
}
func (cache *defaultFontCache) Load(fontData FontData) (font *truetype.Font, err error) {
if font = cache.fonts[cache.namer(fontData)]; font != nil {
return font, nil
}
var data []byte
var file = cache.namer(fontData)