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