Fix unnecessary filesystem access

Fixes #105.
This commit is contained in:
kortschak 2016-07-12 16:24:44 +09:30
parent 155ff5c755
commit e0e534f3a5
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)