-
Notifications
You must be signed in to change notification settings - Fork 0
/
fonts.go
40 lines (35 loc) · 811 Bytes
/
fonts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package assets
import (
"log"
"github.com/golang/freetype/truetype"
"golang.org/x/image/font"
"golang.org/x/image/font/gofont/gomonobold"
)
var (
MapGenFontFace font.Face
MapGenDebugFontFace font.Face
GameInfoFontFace font.Face
DescriptionFontFace font.Face
MenuTitleFontFace font.Face
)
func init() {
tfont, err := truetype.Parse(gomonobold.TTF)
if err != nil {
log.Fatal(err)
}
MapGenFontFace = truetype.NewFace(tfont, &truetype.Options{
Size: 27,
})
MapGenDebugFontFace = truetype.NewFace(tfont, &truetype.Options{
Size: 12,
})
GameInfoFontFace = truetype.NewFace(tfont, &truetype.Options{
Size: 32,
})
DescriptionFontFace = truetype.NewFace(tfont, &truetype.Options{
Size: 24,
})
MenuTitleFontFace = truetype.NewFace(tfont, &truetype.Options{
Size: 36,
})
}