Add FontFileNamer type, set default fontNamer.

This commit is contained in:
Steven Edwards 2015-08-09 12:43:37 -04:00
parent 994e11cd6d
commit d0cd538261

View file

@ -13,8 +13,9 @@ import (
)
var (
fontFolder = "../resource/font/"
fonts = make(map[string]*truetype.Font)
fontFolder = "../resource/font/"
fonts = make(map[string]*truetype.Font)
fontNamer FontFileNamer = FontFileName
)
type FontStyle byte
@ -39,6 +40,8 @@ type FontData struct {
Style FontStyle
}
type FontFileNamer func(fontData FontData) string
func FontFileName(fontData FontData) string {
fontFileName := fontData.Name
switch fontData.Family {