红旗Linux下使java程序正常显示中文
我使用的是simsun.ttc,其他的字体也可以,也可以使用linux自带的字体
1:在window系统中拷贝一个宋体字文件simsun.ttc
2:安装这个字体到系统中,一般情况下红旗Linux会把字体安装到/usr/local/share/fonts/目录下面
3:打开fonts.dir文件,会发现在最后多出你刚才安装的字体的名称。
4:将simsun.ttc拷贝到jre目录下的lib/fonts目录中,并编辑该目录的fonts.dir文件。把刚才打开的fonts.dir文件中关于宋体的部分拷贝到jre/lib/fonts/fonts.dir文件中。并修改最上面的行数为现在的行数(不包括文件的第一行)。保存jre/lib/fonts/fonts.dir。
simsun.ttc -misc-SimSun-Medium-r-Normal--0-0-0-0-p-0-iso8859-1
simsun.ttc -misc-SimSun-Medium-r-Normal--0-0-0-0-p-0-koi8-r
simsun.ttc -misc-SimSun-Medium-r-Normal--0-0-0-0-c-0-jisx0208.1983-0
simsun.ttc -misc-SimSun-Medium-r-Normal--0-0-0-0-c-0-jisx0208.1990-0
simsun.ttc -misc-SimSun-Medium-r-Normal--0-0-0-0-c-0-gb2312.1980-0
simsun.ttc -misc-SimSun-Medium-r-Normal--0-0-0-0-p-0-gb18030.2000-0
simsun.ttc -misc-SimSun-Medium-r-Normal--0-0-0-0-p-0-gbk-0
simsun.ttc -misc-SimSun-Medium-r-Normal--0-0-0-0-p-0-microsoft-win3.1
simsun.ttc -misc-SimSun-Medium-r-Normal--0-0-0-0-p-0-iso10646
5:编辑jre/lib/fontconfig.properties文件
# @(#)linux.fontconfig.properties 1.2 03/10/28
#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
#
# Version
version=1
# Component Font Mappings
allfonts.chinese-gb18030=-misc-SimSun-Medium-r-Normal--0-0-0-0-p-0-gb18030.2000-0
allfonts.chinese-gb18030.motif=-misc-SimSun-Medium-r-Normal--0-0-0-0-c-0-gb2312.1980-0
serif.plain.latin-1=-b&h-lucidabright-medium-r-normal--*-%d-*-*-p-*-iso8859-1
serif.bold.latin-1=-b&h-lucidabright-demibold-r-normal--*-%d-*-*-p-*-iso8859-1
serif.italic.latin-1=-b&h-lucidabright-medium-i-normal--*-%d-*-*-p-*-iso8859-1
serif.bolditalic.latin-1=-b&h-lucidabright-demibold-i-normal--*-%d-*-*-p-*-iso8859-1
sansserif.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1
sansserif.bold.latin-1=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1
sansserif.italic.latin-1=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1
sansserif.bolditalic.latin-1=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1
monospaced.plain.latin-1=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1
monospaced.bold.latin-1=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1
monospaced.italic.latin-1=-b&h-lucidatypewriter-medium-i-normal-sans-*-%d-*-*-m-*-iso8859-1
monospaced.bolditalic.latin-1=-b&h-lucidatypewriter-bold-i-normal-sans-*-%d-*-*-m-*-iso8859-1
dialog.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1
dialog.bold.latin-1=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1
dialog.italic.latin-1=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1
dialog.bolditalic.latin-1=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1
dialoginput.plain.latin-1=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1
dialoginput.bold.latin-1=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1
dialoginput.italic.latin-1=-b&h-lucidatypewriter-medium-i-normal-sans-*-%d-*-*-m-*-iso8859-1
dialoginput.bolditalic.latin-1=-b&h-lucidatypewriter-bold-i-normal-sans-*-%d-*-*-m-*-iso8859-1
# Search Sequences
sequence.allfonts=latin-1
sequence.allfonts.GB2312=latin-1,chinese-gb18030
sequence.allfonts.GB18030=latin-1,chinese-gb18030
# Exclusion Ranges
# Font File Names
黑体部分是我加如入的。
【作者: Liberal】【访问统计:<script language="JavaScript" src="http://counter.blogchina.com/PageServlet?pageid=5991677&blogid=8561"></script>】【2006年12月26日 星期二 22:00】【注册】【打印】