一:COPY字体文件,生成字体索引文件
将 c:\windows\Fonts\simsun.ttc 文件copy到linux下对应目录($JAVA_HOME/jre/lib/fonts/)
执行下面的命令
cd $JAVA_HOME/jre/lib/fonts/
mkfontscale #该命令在当前目录下生成fonts.scale文件
mkfontdir #该命令在当前目录下生成fonts.dir文件
二:修改JRE的字体配置文件($JAVA_HOME/jre/lib/fonts/fontconfig.RedHat.5.properties),不同的操作系统名字可能不一样
找到下面这行
allfonts.chinese-cn-iso10646=-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
修改为
allfonts.chinese-cn-iso10646=-misc-simsun-medium-r-normal--*-%d-*-*-p-*-iso10646-1
说明:JRE配置文件确定有以下规则
Loading Font Configuration Files
To find the appropriate font configuration file for a host operating system, the following information is used:
JavaHome - the JRE's directory, as given by the "java.home" system property.
OS - a string identifyin