A simple font-caching utility enabled by golang/freetype#19.
A simple example:
import (
"log"
"github.com/stephenwithav/fontcache"
)
func main() {
fontPath := "./fonts"
fc := fontcache.New()
fc.Init(fontPath)
// Retrieve font by name for use in a program.
font, err := fc.Get("Luxi Sans", "Regular")
if err != nil {
log.Fatalf("%s", err)
}
DoStuff(font)
}