Linux下生成图片中文乱码

这是由于系统中缺少相应字体库导致的

    1. yum -y install fontconfig
    2. 将你电脑下C:windowsfonts下的一下字体拷贝出来放在桌面
    3. 在/usr/share/fonts下新建文件夹chinese,通过rz将字体上传
    4. 改变这个文件夹的目录权限:chmod -R 755 /usr/share/fonts/chinese
    5. yum -y install ttmkfdir 安装ttmkfdir
    6. ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir
    7. vi /etc/fonts/fonts.conf修改字体配置文件
      在配置文件中增加一行 <dir>/usr/share/fonts/chinese</dir>
    8. fc-cache清楚缓存
    9. shutdown -r now重启服务器
原文地址:https://www.cnblogs.com/qingmuchuanqi48/p/12861273.html