nanmu42/orly

启动报错 rly exits with error: SourceHanSans-Medium.ttc: no such file or directory

Closed this issue · 4 comments


df2020@df2020-K84HR:~/orly/bin$ ./rly 
2020/10/30 21:23:55 maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined
Using specified config file config.toml, content
CoverImageDir = "../../coverimage"
Debug = false
MaxImageID = 40
NormalFont = "../../font/SourceHanSans-Medium.ttc"
ORLYFont = "../../font/SourceHanSans-Heavy.ttc"
Port = ":3000"
QueueLen = 20
TitleFont = "../../font/SourceHanSerif-Bold.ttc"
Width = 800
WorkerNum = 4

{"level":"info","ts":1604064235.7881098,"caller":"rly/main.go:65","msg":"O'rly Generator API starting...","version":"1.4.0-9-g37fc4a1","buildAt":"2020-10-30T21:16:29+0800"}
{"level":"error","ts":1604064235.788324,"caller":"rly/main.go:40","msg":"rly exits with error","error":"initializeFactory: LoadFont normalFont: ReadFile: open ../../font/SourceHanSans-Medium.ttc: no such file or directory","errorVerbose":"open ../../font/SourceHanSans-Medium.ttc: no such file or directory\nReadFile\ngithub.com/nanmu42/orly.LoadFont\n\tgithub.com/nanmu42/orly/fontloader.go:15\nmain.initializeFactory\n\tgithub.com/nanmu42/orly/cmd/rly/factory.go:22\nmain.main\n\tgithub.com/nanmu42/orly/cmd/rly/main.go:69\nruntime.main\n\truntime/proc.go:204\nruntime.goexit\n\truntime/asm_amd64.s:1374\nLoadFont normalFont\nmain.initializeFactory\n\tgithub.com/nanmu42/orly/cmd/rly/factory.go:24\nmain.main\n\tgithub.com/nanmu42/orly/cmd/rly/main.go:69\nruntime.main\n\truntime/proc.go:204\nruntime.goexit\n\truntime/asm_amd64.s:1374\ninitializeFactory\nmain.main\n\tgithub.com/nanmu42/orly/cmd/rly/main.go:71\nruntime.main\n\truntime/proc.go:204\nruntime.goexit\n\truntime/asm_amd64.s:1374","stacktrace":"main.main.func1\n\tgithub.com/nanmu42/orly/cmd/rly/main.go:40\nmain.main\n\tgithub.com/nanmu42/orly/cmd/rly/main.go:72\nruntime.main\n\truntime/proc.go:204"}

无论我用win启动还是linux 都显示这个错误

错误的原因在日志里提现出来了:initializeFactory: LoadFont normalFont: ReadFile: open ../../font/SourceHanSans-Medium.ttc: no such file or directory,检查你的SourceHanSans-Medium.ttc文件是否位于配置文件中声明的约定位置。

这些素材文件的获取可以参考:https://github.com/nanmu42/orly/blob/master/Dockerfile


For English speakers:

Ways to acquire static assets(fonts and cover images) are listed in https://github.com/nanmu42/orly/blob/master/Dockerfile .

错误的原因在日志里提现出来了:initializeFactory: LoadFont normalFont: ReadFile: open ../../font/SourceHanSans-Medium.ttc: no such file or directory,检查你的SourceHanSans-Medium.ttc文件是否位于配置文件中声明的约定位置。

这些素材文件的获取可以参考:https://github.com/nanmu42/orly/blob/master/Dockerfile

For English speakers:

Ways to acquire static assets(fonts and cover images) are listed in https://github.com/nanmu42/orly/blob/master/Dockerfile .

我是直接安装readme中 下载下来 再直接make all的 但是我也看到解压过程

错误的原因在日志里提现出来了:initializeFactory: LoadFont normalFont: ReadFile: open ../../font/SourceHanSans-Medium.ttc: no such file or directory,检查你的SourceHanSans-Medium.ttc文件是否位于配置文件中声明的约定位置。

这些素材文件的获取可以参考:https://github.com/nanmu42/orly/blob/master/Dockerfile

For English speakers:

Ways to acquire static assets(fonts and cover images) are listed in https://github.com/nanmu42/orly/blob/master/Dockerfile .

第一,你那个 https://github.com/nanmu42/orly/tree/master/cmd/rly 中的配置文件路径是错误的,只需要 ./fonts/SourceHanSerif-Bold.ttc 就行了
第二,提供的下载没有 SourceHanSans-Heavy.ttc 这个文件 只有二个ttc,一个ttf字体文件

等等,我懂你的意思了。有个字体后来换掉了。

这个是我的配置:

CoverImageDir = "cover-images"
Debug = false
MaxImageID = 40
Port = ":3000"
TitleFont = "fonts/SourceHanSerif-Bold.ttc"
NormalFont = "fonts/SourceHanSans-Medium.ttc"
ORLYFont = "fonts/SourceSansPro-Black.ttf"
QueueLen = 20
WorkerNum = 2
Width = 1000

谢了。