diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-01-24 00:27:50 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:44 +0100 |
| commit | 73d40903aecad3efcf7c6055c133f0db86558203 (patch) | |
| tree | e9c8f00fb186e270da92f273f570579f2d0b0d95 /go/font | |
| parent | fbba48698d8f8b83dfd7d914b0e37338e0d4e2ef (diff) | |
| download | muhqs-game-73d40903aecad3efcf7c6055c133f0db86558203.tar.gz muhqs-game-73d40903aecad3efcf7c6055c133f0db86558203.zip | |
intermediate commit
Diffstat (limited to 'go/font')
| -rw-r--r-- | go/font/font.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/go/font/font.go b/go/font/font.go new file mode 100644 index 00000000..1ff9b64d --- /dev/null +++ b/go/font/font.go @@ -0,0 +1,24 @@ +package font + +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) + } +} |
