aboutsummaryrefslogtreecommitdiff
path: root/go/font
diff options
context:
space:
mode:
Diffstat (limited to 'go/font')
-rw-r--r--go/font/font.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/go/font/font.go b/go/font/font.go
index 1ff9b64d..ae75cf8d 100644
--- a/go/font/font.go
+++ b/go/font/font.go
@@ -8,7 +8,9 @@ import (
"golang.org/x/image/font/opentype"
)
-var Font font.Face
+var Font24 font.Face
+var Font18 font.Face
+var Font12 font.Face
func InitFont() {
tt, err := opentype.Parse(goregular.TTF)
@@ -17,7 +19,19 @@ func InitFont() {
}
opts := &opentype.FaceOptions{Size: 24, DPI: 72}
- Font, err = opentype.NewFace(tt, opts)
+ Font24, err = opentype.NewFace(tt, opts)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ opts = &opentype.FaceOptions{Size: 18, DPI: 72}
+ Font18, err = opentype.NewFace(tt, opts)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ opts = &opentype.FaceOptions{Size: 12, DPI: 72}
+ Font12, err = opentype.NewFace(tt, opts)
if err != nil {
log.Fatal(err)
}