From 42fe708263d644b2d62b777fdedaba3540b4fba6 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 3 Oct 2020 20:24:05 +0900 Subject: [PATCH] Revert "examples/text: Use golang.org/x/image/font/opentype" This reverts commit 013a42ddb88dbacdb1398c8d81e1bcb560f7781d. Reason: #1377 --- examples/text/main.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/text/main.go b/examples/text/main.go index 2b772c683..f5c5d470d 100644 --- a/examples/text/main.go +++ b/examples/text/main.go @@ -22,8 +22,8 @@ import ( "math/rand" "time" + "github.com/golang/freetype/truetype" "golang.org/x/image/font" - "golang.org/x/image/font/opentype" "github.com/hajimehoshi/ebiten" "github.com/hajimehoshi/ebiten/ebitenutil" @@ -45,28 +45,22 @@ var ( ) func init() { - tt, err := opentype.Parse(fonts.MPlus1pRegular_ttf) + tt, err := truetype.Parse(fonts.MPlus1pRegular_ttf) if err != nil { log.Fatal(err) } const dpi = 72 - mplusNormalFont, err = opentype.NewFace(tt, &opentype.FaceOptions{ + mplusNormalFont = truetype.NewFace(tt, &truetype.Options{ Size: 24, DPI: dpi, Hinting: font.HintingFull, }) - if err != nil { - log.Fatal(err) - } - mplusBigFont, err = opentype.NewFace(tt, &opentype.FaceOptions{ + mplusBigFont = truetype.NewFace(tt, &truetype.Options{ Size: 32, DPI: dpi, Hinting: font.HintingFull, }) - if err != nil { - log.Fatal(err) - } } func init() {