noneplugin / nonebot-plugin-memes

Nonebot2 表情包制作插件
MIT License
224 stars 20 forks source link

字体载入错误 #31

Closed wu5288540 closed 1 year ago

wu5288540 commented 1 year ago

先是发现日志里提示

01-13 16:59:40 [INFO] nonebot_plugin_memes | 正在检查资源文件... findfont: Font family ['Noto Sans SC'] not found. Falling back to DejaVu Sans. findfont: Font family ['Noto Serif SC'] not found. Falling back to DejaVu Sans.

而后输出日志下载失败

到nonebot的data/font文件夹里没有发现这两个字体,尝试手动下载放入NotoSansSC-Regular.otf和NotoSerifSC-Regular.otf,重启bot后输出 01-13 16:59:30 [WARNING] nonebot_plugin_imageutils | Failed to extract font properties from /root/nbot/data/fonts/NotoSerifSC-Regular.otf: In FT2Font: Can not load face (unknown file format; error code 0x2) 01-13 16:59:30 [WARNING] nonebot_plugin_imageutils | Failed to extract font properties from /root/nbot/data/fonts/NotoSansSC-Regular.otf: In FT2Font: Can not load face (unknown file format; error code 0x2)

这可咋整

系统是centos8, Python版本3.10

wu5288540 commented 1 year ago

破案了,我下载的字体文件不知道为什么是损坏格式,只有100多kb,重新下载正常版本替换之后可用了

但下载失败的问题还是没有解决,服务器在美国应该不是墙的问题,迷惑

总之手动补资源解决成功了

wu5288540 commented 1 year ago

由于插件启动时必定会检测资源更新,虽然手动补齐了资源,但日志仍然输出了下载失败的内容 [WARNING] nonebot_plugin_memes | Error downloading https://ghproxy.com/https://raw.githubusercontent.com/noneplugin/nonebot-plugin-memes/v0.3.x/resources/resource_list.json, retry 1/3

测试了下资源下载的URL,https://ghproxy.com/https://raw.githubusercontent.com/noneplugin/nonebot-plugin-memes/v0.3.x/resources 显示404: not found 这个URL是否因为文件结构变动导致指向了错误的地址?

MeetWq commented 1 year ago

https://ghproxy.com/https://raw.githubusercontent.com/noneplugin/nonebot-plugin-memes/v0.3.x/resources/resource_list.json

这个链接是没问题的,可能只是网络问题或者github反代的问题