diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-03-01 22:19:04 +0100 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-03-01 22:19:04 +0100 |
| commit | 2e8da8cb6948664a77fa73cb0c66e0cc27419dc5 (patch) | |
| tree | 4fc675ec3c5233dd44b2798d0e6542b8f411e1a7 /main.go | |
| parent | 13aafdc1295431b1fedd08cc5900eb6f3ef9fda4 (diff) | |
Switch font to Cinzel variable font
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -18,7 +18,7 @@ import ( "github.com/hajimehoshi/ebiten/v2/text/v2" "github.com/martinlehoux/kagamigo/kcore" "golang.org/x/exp/slog" - "golang.org/x/image/font/gofont/goregular" + ) type Action string @@ -205,7 +205,9 @@ func main() { game := &Game{ ResourceAmount: 150, } - s, err := text.NewGoTextFaceSource(bytes.NewReader(goregular.TTF)) + fontData, err := os.ReadFile("fonts/Cinzel-VariableFont_wght.ttf") + kcore.Expect(err, "failed to read font") + s, err := text.NewGoTextFaceSource(bytes.NewReader(fontData)) kcore.Expect(err, "failed to create font source") game.FaceSource = s ironMineBuilder := NewEntityBuilder().WithSolid(NewFilledRectangleImage(physics.Point{X: 100, Y: 100}, color.RGBA{0x80, 0x80, 0x80, 0xff})).WithResourceSource(1000).WithSelectable("square", selection.Building) |
