mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-24 01:42:05 +01:00
parent
aa9f7f7c19
commit
013a42ddb8
@ -22,8 +22,8 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"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/ebitenutil"
|
"github.com/hajimehoshi/ebiten/ebitenutil"
|
||||||
@ -45,22 +45,28 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
tt, err := truetype.Parse(fonts.MPlus1pRegular_ttf)
|
tt, err := opentype.Parse(fonts.MPlus1pRegular_ttf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
const dpi = 72
|
const dpi = 72
|
||||||
mplusNormalFont = truetype.NewFace(tt, &truetype.Options{
|
mplusNormalFont, err = opentype.NewFace(tt, &opentype.FaceOptions{
|
||||||
Size: 24,
|
Size: 24,
|
||||||
DPI: dpi,
|
DPI: dpi,
|
||||||
Hinting: font.HintingFull,
|
Hinting: font.HintingFull,
|
||||||
})
|
})
|
||||||
mplusBigFont = truetype.NewFace(tt, &truetype.Options{
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
mplusBigFont, err = opentype.NewFace(tt, &opentype.FaceOptions{
|
||||||
Size: 32,
|
Size: 32,
|
||||||
DPI: dpi,
|
DPI: dpi,
|
||||||
Hinting: font.HintingFull,
|
Hinting: font.HintingFull,
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
Loading…
Reference in New Issue
Block a user