Revert "examples/fullscreen: Use golang.org/x/image/font/opentype"

This reverts commit b264a421ae.

Reason: #1377
This commit is contained in:
Hajime Hoshi 2020-10-03 20:25:02 +09:00
parent 42fe708263
commit 041377a9a2

View File

@ -26,8 +26,8 @@ import (
"log"
"math"
"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"
@ -59,20 +59,17 @@ func init() {
}
func initFont() {
tt, err := opentype.Parse(fonts.MPlus1pRegular_ttf)
tt, err := truetype.Parse(fonts.MPlus1pRegular_ttf)
if err != nil {
log.Fatal(err)
}
const dpi = 72
mplusFont, err = opentype.NewFace(tt, &opentype.FaceOptions{
mplusFont = truetype.NewFace(tt, &truetype.Options{
Size: 12 * ebiten.DeviceScaleFactor(),
DPI: dpi,
Hinting: font.HintingFull,
})
if err != nil {
log.Fatal(err)
}
}
type Game struct {