aboutsummaryrefslogtreecommitdiff
path: root/go/ui/font.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-01-20 03:18:06 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-01-27 16:43:44 +0100
commitc4cb9637f5c85d03aa162968f0dfec3c193fc9dc (patch)
tree3ad32e5dfd7c4ae72f66b86e77edef7b700a8b7a /go/ui/font.go
parent9df5cc7b55d8ac9ecd775a14a14f80a6c36c4d74 (diff)
downloadmuhqs-game-c4cb9637f5c85d03aa162968f0dfec3c193fc9dc.tar.gz
muhqs-game-c4cb9637f5c85d03aa162968f0dfec3c193fc9dc.zip
intermediate commit
Implement actions and multiple ui widgets
Diffstat (limited to 'go/ui/font.go')
-rw-r--r--go/ui/font.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/go/ui/font.go b/go/ui/font.go
new file mode 100644
index 00000000..065ac0d8
--- /dev/null
+++ b/go/ui/font.go
@@ -0,0 +1,24 @@
+package ui
+
+import (
+ "log"
+
+ "golang.org/x/image/font"
+ "golang.org/x/image/font/gofont/goregular"
+ "golang.org/x/image/font/opentype"
+)
+
+var Font font.Face
+
+func InitFont() {
+ tt, err := opentype.Parse(goregular.TTF)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ opts := &opentype.FaceOptions{Size: 24, DPI: 72}
+ Font, err = opentype.NewFace(tt, opts)
+ if err != nil {
+ log.Fatal(err)
+ }
+}