mirror of
https://github.com/make-42/xyosc
synced 2025-01-18 18:57:10 +01:00
23 lines
456 B
Go
23 lines
456 B
Go
package fonts
|
|
|
|
import (
|
|
"xyosc/utils"
|
|
|
|
"embed"
|
|
|
|
"github.com/hajimehoshi/ebiten/v2/text/v2"
|
|
)
|
|
|
|
//go:embed assets/SourceHanSansJP-Heavy.otf
|
|
var embedFS embed.FS
|
|
|
|
var Font *text.GoTextFaceSource
|
|
|
|
func Init() {
|
|
// NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
|
|
f, err := embedFS.Open("assets/SourceHanSansJP-Heavy.otf")
|
|
utils.CheckError(err)
|
|
Font, err = text.NewGoTextFaceSource(f)
|
|
utils.CheckError(err)
|
|
}
|