From 75220464bf0e0a21a6526b7d8a30596b8fc8915a Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 4 Sep 2025 13:23:31 +0200 Subject: use the latin modern math font --- go/font/embed.go | 12 ++++++++++++ go/font/font.go | 4 +--- go/font/latinmodern-math.otf | Bin 0 -> 733736 bytes 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 go/font/embed.go create mode 100644 go/font/latinmodern-math.otf diff --git a/go/font/embed.go b/go/font/embed.go new file mode 100644 index 00000000..07fb85f0 --- /dev/null +++ b/go/font/embed.go @@ -0,0 +1,12 @@ +// limitations under the License. + +package font + +import ( + _ "embed" +) + +var ( + //go:embed latinmodern-math.otf + LatinModernMathOtf []byte +) diff --git a/go/font/font.go b/go/font/font.go index 9e016045..dbadcc6f 100644 --- a/go/font/font.go +++ b/go/font/font.go @@ -4,8 +4,6 @@ import ( "bytes" "log" - "golang.org/x/image/font/gofont/goregular" - "github.com/hajimehoshi/ebiten/v2/text/v2" ) @@ -17,7 +15,7 @@ var Font18 *text.GoTextFace var Font12 *text.GoTextFace func InitFont() { - fontSource, err := text.NewGoTextFaceSource(bytes.NewReader(goregular.TTF)) + fontSource, err := text.NewGoTextFaceSource(bytes.NewReader(LatinModernMathOtf)) if err != nil { log.Fatal(err) } diff --git a/go/font/latinmodern-math.otf b/go/font/latinmodern-math.otf new file mode 100644 index 00000000..0e4642e9 Binary files /dev/null and b/go/font/latinmodern-math.otf differ -- cgit v1.2.3