Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

中文变成白框 #22

Closed
MIt-gancm opened this issue Apr 5, 2023 · 9 comments
Closed

中文变成白框 #22

MIt-gancm opened this issue Apr 5, 2023 · 9 comments

Comments

@MIt-gancm
Copy link

在重装系统之后 我又装了机器人以及这个脚本 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
之后 中文依然是方框

Copy link
Owner

MeetWq commented Apr 5, 2023

按照说明删除字体缓存试试

@happy-bear-x
Copy link

按照说明删除字体缓存试试

我是centos,把windows下大部分中文字体拷贝了,还把说明里面的windows emoj也拷贝了,也执行了 fc-cache -fv,中文还是白框。

@happy-bear-x
Copy link

按照说明删除字体缓存试试

我是centos,把windows下大部分中文字体拷贝了,还把说明里面的windows emoj也拷贝了,也执行了 fc-cache -fv,中文还是白框。

按照说明,删除缓存的json文件后可以正常显示中文了。

@MIt-gancm
Copy link
Author

MIt-gancm commented Apr 7, 2023 via email

@MeetWq MeetWq closed this as completed Apr 15, 2023
@OnlyblackTea
Copy link

发行版: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,然而还是生成方块字……

@M1hono
Copy link

M1hono commented Sep 25, 2024

发行版: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,然而还是生成方块字……

我也有相同的问题。

@OnlyblackTea
Copy link

或许可以参考matplotlib相关的解决办法

@M1hono
Copy link

M1hono commented Sep 25, 2024

或许可以参考matplotlib相关的解决办法
您找到解决的方法了吗?

@M1hono
Copy link

M1hono commented Sep 25, 2024

或许可以参考matplotlib相关的解决办法

我靠删除.cache/matplotlib/fontlist-xxx.json后解决了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants