mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
parent
774eb0ea82
commit
3f1d0788f5
@ -27,8 +27,8 @@ import (
|
||||
"math/rand"
|
||||
"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/audio"
|
||||
@ -92,21 +92,27 @@ func init() {
|
||||
}
|
||||
|
||||
func init() {
|
||||
tt, err := truetype.Parse(fonts.ArcadeN_ttf)
|
||||
tt, err := opentype.Parse(fonts.PressStart2P_ttf)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
const dpi = 72
|
||||
arcadeFont = truetype.NewFace(tt, &truetype.Options{
|
||||
arcadeFont, err = opentype.NewFace(tt, &opentype.FaceOptions{
|
||||
Size: fontSize,
|
||||
DPI: dpi,
|
||||
Hinting: font.HintingFull,
|
||||
})
|
||||
smallArcadeFont = truetype.NewFace(tt, &truetype.Options{
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
smallArcadeFont, err = opentype.NewFace(tt, &opentype.FaceOptions{
|
||||
Size: smallFontSize,
|
||||
DPI: dpi,
|
||||
Hinting: font.HintingFull,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -22,8 +22,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/audio"
|
||||
@ -38,7 +38,7 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
tt, err := truetype.Parse(fonts.ArcadeN_ttf)
|
||||
tt, err := opentype.Parse(fonts.PressStart2P_ttf)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@ -47,11 +47,14 @@ func init() {
|
||||
arcadeFontSize = 8
|
||||
dpi = 72
|
||||
)
|
||||
arcadeFont = truetype.NewFace(tt, &truetype.Options{
|
||||
arcadeFont, err = opentype.NewFace(tt, &opentype.FaceOptions{
|
||||
Size: arcadeFontSize,
|
||||
DPI: dpi,
|
||||
Hinting: font.HintingFull,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
const (
|
||||
|
Loading…
Reference in New Issue
Block a user