mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-10-28 02:11:43 +08:00
Revert "examples/fullscreen: Use golang.org/x/image/font/opentype"
This reverts commit b264a421ae.
Reason: #1377
This commit is contained in:
@@ -26,8 +26,8 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
|
"github.com/golang/freetype/truetype"
|
||||||
"golang.org/x/image/font"
|
"golang.org/x/image/font"
|
||||||
"golang.org/x/image/font/opentype"
|
|
||||||
|
|
||||||
"github.com/hajimehoshi/ebiten"
|
"github.com/hajimehoshi/ebiten"
|
||||||
"github.com/hajimehoshi/ebiten/examples/resources/fonts"
|
"github.com/hajimehoshi/ebiten/examples/resources/fonts"
|
||||||
@@ -59,20 +59,17 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initFont() {
|
func initFont() {
|
||||||
tt, err := opentype.Parse(fonts.MPlus1pRegular_ttf)
|
tt, err := truetype.Parse(fonts.MPlus1pRegular_ttf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
const dpi = 72
|
const dpi = 72
|
||||||
mplusFont, err = opentype.NewFace(tt, &opentype.FaceOptions{
|
mplusFont = truetype.NewFace(tt, &truetype.Options{
|
||||||
Size: 12 * ebiten.DeviceScaleFactor(),
|
Size: 12 * ebiten.DeviceScaleFactor(),
|
||||||
DPI: dpi,
|
DPI: dpi,
|
||||||
Hinting: font.HintingFull,
|
Hinting: font.HintingFull,
|
||||||
})
|
})
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Game struct {
|
type Game struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user