我们使用中文字符集时候如果指定特定格式,比如宋体,黑体等如果产生乱码。

我们可以从windows 下导入相关的ttf。

1.首先在windows c:\windows\fonts\下找到想要使用的字体 (*.ttf文件)

2.上传到docker 内部 /usr/share/fonts/下面

3.给予权限 chmod 755 *.tff

4.建立字体缓存

  1. #mkfontscale (如果没有需要安装 apt-get install ttf-mscorefonts-installer)
  2. #mkfontdir
  3. #fc-cache -fv (如果没有需要安装 apt-get install fontconfig)
  4. #fc-list(查看字体列表)
文档更新时间: 2022-02-21 09:00   作者:张尚