aboutsummaryrefslogtreecommitdiff
path: root/go/font
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-01-26 22:16:10 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-01-27 16:43:44 +0100
commit926ca5cdd20a39e3e05aaa3486cb166718dab5ca (patch)
tree3d7bc8a0e1e0be1ce8d92d5503bdede878e718e9 /go/font
parent8720ebf9c74d9e11001772b5c00c293fa3a8b9e5 (diff)
downloadmuhqs-game-926ca5cdd20a39e3e05aaa3486cb166718dab5ca.tar.gz
muhqs-game-926ca5cdd20a39e3e05aaa3486cb166718dab5ca.zip
intermeditae commit
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)
}