Add RegisterFont

This commit is contained in:
Laurent Le Goff 2012-04-16 23:23:08 +02:00
parent 7f2c247e7a
commit 6d19118a1c

View file

@ -37,6 +37,10 @@ type FontData struct {
Style FontStyle Style FontStyle
} }
func RegisterFont(fontfilename string, font *truetype.Font) {
fonts[fontfilename] = font
}
func GetFont(fontData FontData) *truetype.Font { func GetFont(fontData FontData) *truetype.Font {
fontFileName := fontData.Name fontFileName := fontData.Name
switch fontData.Family { switch fontData.Family {