中文变成白框
Closed this issue · 9 comments
在重装系统之后 我又装了机器人以及这个脚本 unban 22 server 但这次 在执行完成
sudo apt install fonts-noto-cjk fonts-noto-color-emoji
sudo locale-gen zh_CN zh_CN.UTF-8
sudo update-locale LC_ALL=zh_CN.UTF-8 LANG=zh_CN.UTF-8
fc-cache -fv
之后 中文依然是方框
按照说明删除字体缓存试试
按照说明删除字体缓存试试
我是centos,把windows下大部分中文字体拷贝了,还把说明里面的windows emoj也拷贝了,也执行了 fc-cache -fv,中文还是白框。
按照说明删除字体缓存试试
我是centos,把windows下大部分中文字体拷贝了,还把说明里面的windows emoj也拷贝了,也执行了 fc-cache -fv,中文还是白框。
按照说明,删除缓存的json文件后可以正常显示中文了。
发行版:Ubuntu 22.04 LTS
我因为一些原因无法使用sudo,所以我把字体上传到~/.local/share/fonts目录下,执行了fc-cache -fv
执行过程中可以看到~/.local/share/fonts目录的字体被缓存
同时,删除了~/.cache/matplotlib/fontlist-v330.json,重新运行nb生成了新的缓存文件
可以在新的缓存文件中找到我新安装的字体:
"fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Light.ttf",
"fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-ExtraLight.ttf",
"fname": "/home/vbot/.local/share/fonts/NotoSerifSC-Regular.otf",
"fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Medium.ttf",
"fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-ExtraBold.ttf",
"fname": "/home/vbot/.local/share/fonts/NotoSansSC-Regular.otf",
"fname": "/home/vbot/.local/share/fonts/FZKATJW.ttf",
"fname": "/home/vbot/.local/share/fonts/WenQuanWeiMiHei-1.ttf",
"fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Bold.ttf",
"fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Thin.ttf",
"fname": "/home/vbot/.local/share/fonts/Noto-COLRv1-noflags.ttf",
"fname": "/home/vbot/.local/share/fonts/FZSEJW.ttf",
"fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Regular.ttf",
"fname": "/home/vbot/.local/share/fonts/Noto-COLRv1.ttf",
"fname": "/home/vbot/.local/share/fonts/consola.ttf",
"fname": "/home/vbot/.local/share/fonts/simhei.ttf",
"fname": "/home/vbot/.local/share/fonts/FZSJ-QINGCRJ.ttf",
"fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Black.ttf",
"fname": "/home/vbot/.local/share/fonts/FZXS14.ttf",
"fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-SemiBold.ttf",
"fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/NotoSansSC-VariableFont_wght.ttf",
"fname": "/home/vbot/.local/share/fonts/Aller_Bd.ttf",
"fname": "/home/vbot/.local/share/fonts/HiraginoMin-W5-90-RKSJ-H-2.ttc",
重新运行nb,然而还是生成方块字……
发行版:Ubuntu 22.04 LTS 我因为一些原因无法使用sudo,所以我把字体上传到~/.local/share/fonts目录下,执行了fc-cache -fv 执行过程中可以看到~/.local/share/fonts目录的字体被缓存
同时,删除了~/.cache/matplotlib/fontlist-v330.json,重新运行nb生成了新的缓存文件 可以在新的缓存文件中找到我新安装的字体:
"fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Light.ttf", "fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-ExtraLight.ttf", "fname": "/home/vbot/.local/share/fonts/NotoSerifSC-Regular.otf", "fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Medium.ttf", "fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-ExtraBold.ttf", "fname": "/home/vbot/.local/share/fonts/NotoSansSC-Regular.otf", "fname": "/home/vbot/.local/share/fonts/FZKATJW.ttf", "fname": "/home/vbot/.local/share/fonts/WenQuanWeiMiHei-1.ttf", "fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Bold.ttf", "fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Thin.ttf", "fname": "/home/vbot/.local/share/fonts/Noto-COLRv1-noflags.ttf", "fname": "/home/vbot/.local/share/fonts/FZSEJW.ttf", "fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Regular.ttf", "fname": "/home/vbot/.local/share/fonts/Noto-COLRv1.ttf", "fname": "/home/vbot/.local/share/fonts/consola.ttf", "fname": "/home/vbot/.local/share/fonts/simhei.ttf", "fname": "/home/vbot/.local/share/fonts/FZSJ-QINGCRJ.ttf", "fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-Black.ttf", "fname": "/home/vbot/.local/share/fonts/FZXS14.ttf", "fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/static/NotoSansSC-SemiBold.ttf", "fname": "/home/vbot/.local/share/fonts/Noto_Sans_SC/NotoSansSC-VariableFont_wght.ttf", "fname": "/home/vbot/.local/share/fonts/Aller_Bd.ttf", "fname": "/home/vbot/.local/share/fonts/HiraginoMin-W5-90-RKSJ-H-2.ttc",
重新运行nb,然而还是生成方块字……
我也有相同的问题。
或许可以参考matplotlib相关的解决办法
或许可以参考matplotlib相关的解决办法
您找到解决的方法了吗?
或许可以参考matplotlib相关的解决办法
我靠删除.cache/matplotlib/fontlist-xxx.json后解决了。