From 990ba69d7aabe5da9fd1e4f70c4e148dd8a5e47c Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 3 Oct 2020 20:25:45 +0900 Subject: [PATCH] Revert "examples/2048: Use golang.org/x/image/font/opentype" This reverts commit aa9f7f7c194700c33e08eac18d895b38880e2d59. Reason: #1377 --- examples/2048/2048/tile.go | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/examples/2048/2048/tile.go b/examples/2048/2048/tile.go index b8a99dd06..fb18c7808 100644 --- a/examples/2048/2048/tile.go +++ b/examples/2048/2048/tile.go @@ -22,8 +22,8 @@ import ( "sort" "strconv" + "github.com/golang/freetype/truetype" "golang.org/x/image/font" - "golang.org/x/image/font/opentype" "github.com/hajimehoshi/ebiten" "github.com/hajimehoshi/ebiten/examples/resources/fonts" @@ -37,36 +37,27 @@ 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 - mplusSmallFont, err = opentype.NewFace(tt, &opentype.FaceOptions{ + mplusSmallFont = truetype.NewFace(tt, &truetype.Options{ Size: 24, DPI: dpi, Hinting: font.HintingFull, }) - if err != nil { - log.Fatal(err) - } - mplusNormalFont, err = opentype.NewFace(tt, &opentype.FaceOptions{ + mplusNormalFont = truetype.NewFace(tt, &truetype.Options{ Size: 32, 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: 48, DPI: dpi, Hinting: font.HintingFull, }) - if err != nil { - log.Fatal(err) - } } // TileData represents a tile information like a value and a position.