🐛 fix fontfile notfound error

This commit is contained in:
fumiama
2022-01-14 12:10:05 +08:00
parent 790200e519
commit b676e00f0b
3 changed files with 13 additions and 3 deletions

View File

@@ -5,7 +5,9 @@ import (
log "github.com/sirupsen/logrus"
"github.com/FloatTech/zbputils/file"
"github.com/FloatTech/zbputils/process"
"github.com/FloatTech/zbputils/txt2img"
)
const (
@@ -21,6 +23,14 @@ var sdb *scoredb
func init() {
go func() {
process.SleepAbout1sTo2s()
_, err := file.GetLazyData(txt2img.BoldFontFile, false, true)
if err != nil {
panic(err)
}
_, err = file.GetLazyData(txt2img.FontFile, false, true)
if err != nil {
panic(err)
}
_ = os.MkdirAll(dbpath, 0755)
os.RemoveAll(cachePath)
_ = os.MkdirAll(cachePath, 0755)