diff --git a/examples/font/main.go b/examples/font/main.go index 7793504b6..ac75e947b 100644 --- a/examples/font/main.go +++ b/examples/font/main.go @@ -24,8 +24,8 @@ import ( "strings" "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/examples/resources/fonts" @@ -90,22 +90,28 @@ func init() { } func init() { - tt, err := truetype.Parse(fonts.MPlus1pRegular_ttf) + tt, err := opentype.Parse(fonts.MPlus1pRegular_ttf) if err != nil { log.Fatal(err) } const dpi = 72 - mplusNormalFont = truetype.NewFace(tt, &truetype.Options{ + mplusNormalFont, err = opentype.NewFace(tt, &opentype.FaceOptions{ Size: 24, DPI: dpi, Hinting: font.HintingFull, }) - mplusBigFont = truetype.NewFace(tt, &truetype.Options{ + if err != nil { + log.Fatal(err) + } + mplusBigFont, err = opentype.NewFace(tt, &opentype.FaceOptions{ Size: 48, DPI: dpi, Hinting: font.HintingFull, }) + if err != nil { + log.Fatal(err) + } } func init() { diff --git a/go.mod b/go.mod index 1a8e25fea..620e7ef9f 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/jakecoffman/cp v1.0.0 github.com/jfreymuth/oggvorbis v1.0.1 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - golang.org/x/image v0.0.0-20200801110659-972c09e46d76 + golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 golang.org/x/mobile v0.0.0-20200801112145-973feb4309de golang.org/x/sys v0.0.0-20200918174421-af09f7315aff golang.org/x/tools v0.0.0-20200918232735-d647fc253266 diff --git a/go.sum b/go.sum index 9469d1e77..9ff104513 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9t golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200801110659-972c09e46d76 h1:U7GPaoQyQmX+CBRWXKrvRzWTbd+slqeSh8uARsIyhAw= -golang.org/x/image v0.0.0-20200801110659-972c09e46d76/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 h1:QelT11PB4FXiDEXucrfNckHoFxwt8USGY1ajP1ZF5lM= +golang.org/x/image v0.0.0-20200927104501-e162460cd6b5/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190415191353-3e0bab5405d6/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mobile v0.0.0-20200801112145-973feb4309de h1:OVJ6QQUBAesB8CZijKDSsXX7xYVtUhrkY0gwMfbi4p4=