add Arial.ttf
This commit is contained in:
@@ -10,7 +10,6 @@ import (
|
||||
_ "image/png"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
"github.com/hajimehoshi/ebiten/examples/resources/fonts"
|
||||
"golang.org/x/image/font"
|
||||
"golang.org/x/image/font/opentype"
|
||||
)
|
||||
@@ -36,7 +35,8 @@ func LoadImage(path string) *ebiten.Image {
|
||||
}
|
||||
|
||||
func GetFontFace(layout entity.FontLayout) font.Face {
|
||||
tt, _ := opentype.Parse(fonts.MPlus1pRegular_ttf)
|
||||
file, _ := ioutil.ReadFile(layout.Path)
|
||||
tt, _ := opentype.Parse(file)
|
||||
face, _ := opentype.NewFace(tt, &opentype.FaceOptions{
|
||||
Size: layout.DPI,
|
||||
DPI: layout.Size,
|
||||
|
||||
Reference in New Issue
Block a user