QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1191|回复: 8

很幼地问 jdk 1.5显示中文乱码

[复制链接]
发表于 2005-2-21 23:05:41 | 显示全部楼层 |阅读模式
java 1.5的程序界面上中文是有一半乱码, 另一半汉字能显示.
如: "翻译器" 显示成 "翻囗器"
是不是字体的原故?

换字体, 记得以前jdk 1.4时候, 修改jdk/jre/lib/下的font.properties.zh就可以了.
但jdk 1.5, 是有两个文件
fontconfig.RedHat.bfc
fontconfig.RedHat.properties.src
通过移除文件, 尝试. 只有fontconfig.RedHat.bfc在起作用. fontconf.RedHat.properties.src存不存在, 无所谓.
通过名字看, fontconfig.RedHat.bfc好像是通过fontconfig.RedHat.properties.src编译生成出来的.
请问一下, bfc这文件是用什么生成出来的.
请大虾, 帮忙看一下.

另外:
读src文件, 发现java默认用的中文字体是zysong. 我使的是fc2, 好像已经没有这个安装包了.
发表于 2005-2-21 23:48:57 | 显示全部楼层
在fontconfig.RedHat*的最后应该指出了zysong到底是那个字体,可能它指向的那个字体你的系统里没有。我通常会用simsun替换掉。
还有,似乎fc系列要修改font.properties,其他的文件似乎都不起作用。参照的.zh的改就行了。
回复

使用道具 举报

发表于 2005-2-22 08:25:24 | 显示全部楼层

你的是1.5么?

我的没有你说的文件,哦只保留了fontconfig.properties,其他什么都没有,只有在这个文件里修改字体的路径就好了,你那个yzsong好像是永中宋体,你安装了永中的话,会另安装一个j2re1.4.2_04,是不是两个串了?1。5里没有font.xxxxxxx文件
回复

使用道具 举报

发表于 2005-2-22 08:55:40 | 显示全部楼层
1.5改..fontconfig.properties
我的:[code:1]# @(#)linux.fontconfig.Sun.properties        1.5 03/11/14
#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
#

# Version

version=1

# Component Font Mappings

allfonts.chinese-gbk=-misc-simsun-medium-r-normal--*-%d-*-*-p-*-gbk-0
allfonts.chinese-gb2312=-misc-simsun-medium-r-normal--*-%d-*-*-p-*-gb2312.1980-0
allfonts.chinese-cn-iso10646=-misc-simsun-medium-r-normal--*-%d-*-*-p-*-iso10646-1
allfonts.chinese-big5=-misc-fzmingti-medium-r-normal--*-%d-*-*-p-*-big5-0
allfonts.chinese-tw-iso10646=-misc-fzmingti-medium-r-normal--*-%d-*-*-p-*-iso10646-1
allfonts.chinese-big5hkscs=-misc-fzheiti-medium-r-normal--*-%d-*-*-p-*-big5hkscs-0
allfonts.lucida=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1

serif.plain.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
serif.plain.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.plain.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
serif.plain.latin-1=-b&h-lucidabright-medium-r-normal--*-%d-*-*-p-*-iso8859-1
serif.plain.latin-1.motif=-b&h-luxi serif-medium-r-normal--*-%d-*-*-p-*-iso8859-1

serif.bold.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
serif.bold.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.bold.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
serif.bold.latin-1=-b&h-lucidabright-demibold-r-normal--*-%d-*-*-p-*-iso8859-1
serif.bold.latin-1.motif=-b&h-luxi serif-bold-r-normal--*-%d-*-*-p-*-iso8859-1

serif.italic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
serif.italic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.italic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
serif.italic.latin-1=-b&h-lucidabright-medium-i-normal--*-%d-*-*-p-*-iso8859-1
serif.italic.latin-1.motif=-b&h-luxi serif-medium-i-normal--*-%d-*-*-p-*-iso8859-1

serif.bolditalic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
serif.bolditalic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.bolditalic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
serif.bolditalic.latin-1=-b&h-lucidabright-demibold-i-normal--*-%d-*-*-p-*-iso8859-1
serif.bolditalic.latin-1.motif=-b&h-luxi serif-bold-i-normal--*-%d-*-*-p-*-iso8859-1

sansserif.plain.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
sansserif.plain.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.plain.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
sansserif.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1
sansserif.plain.latin-1.motif=-b&h-luxi sans-medium-r-normal--*-%d-*-*-p-*-iso8859-1

sansserif.bold.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
sansserif.bold.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.bold.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
sansserif.bold.latin-1=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1
sansserif.bold.latin-1.motif=-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1

sansserif.italic.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
sansserif.italic.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.italic.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
sansserif.italic.latin-1=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1
sansserif.italic.latin-1.motif=-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1

sansserif.bolditalic.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
sansserif.bolditalic.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.bolditalic.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
sansserif.bolditalic.latin-1=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1
sansserif.bolditalic.latin-1.motif=-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1

monospaced.plain.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
monospaced.plain.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.plain.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
monospaced.plain.latin-1=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1
monospaced.plain.latin-1.motif=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1

monospaced.bold.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
monospaced.bold.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.bold.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
monospaced.bold.latin-1=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1
monospaced.bold.latin-1.motif=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1

monospaced.italic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
monospaced.italic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.italic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
monospaced.italic.latin-1=-b&h-lucidatypewriter-medium-i-normal-sans-*-%d-*-*-m-*-iso8859-1
monospaced.italic.latin-1.motif=-b&h-luxi mono-medium-i-normal--*-%d-*-*-m-*-iso8859-1

monospaced.bolditalic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
monospaced.bolditalic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.bolditalic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
monospaced.bolditalic.latin-1=-b&h-lucidatypewriter-bold-i-normal-sans-*-%d-*-*-m-*-iso8859-1
monospaced.bolditalic.latin-1.motif=-b&h-luxi mono-bold-i-normal--*-%d-*-*-m-*-iso8859-1

dialog.plain.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialog.plain.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.plain.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialog.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1
dialog.plain.latin-1.motif=-b&h-luxi sans-medium-r-normal--*-%d-*-*-p-*-iso8859-1

dialog.bold.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialog.bold.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.bold.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialog.bold.latin-1=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1
dialog.bold.latin-1.motif=-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1

dialog.italic.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialog.italic.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.italic.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialog.italic.latin-1=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1
dialog.italic.latin-1.motif=-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1

dialog.bolditalic.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialog.bolditalic.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.bolditalic.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialog.bolditalic.latin-1=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1
dialog.bolditalic.latin-1.motif=-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1

dialoginput.plain.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialoginput.plain.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.plain.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialoginput.plain.latin-1=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1
dialoginput.plain.latin-1.motif=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1

dialoginput.bold.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialoginput.bold.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.bold.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialoginput.bold.latin-1=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1
dialoginput.bold.latin-1.motif=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1

dialoginput.italic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialoginput.italic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.italic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialoginput.italic.latin-1=-b&h-lucidatypewriter-medium-i-normal-sans-*-%d-*-*-m-*-iso8859-1
dialoginput.italic.latin-1.motif=-b&h-luxi mono-medium-i-normal--*-%d-*-*-m-*-iso8859-1

dialoginput.bolditalic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialoginput.bolditalic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.bolditalic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialoginput.bolditalic.latin-1=-b&h-lucidatypewriter-bold-i-normal-sans-*-%d-*-*-m-*-iso8859-1
dialoginput.bolditalic.latin-1.motif=-b&h-luxi mono-bold-i-normal--*-%d-*-*-m-*-iso8859-1

# Search Sequences

sequence.allfonts=latin-1
sequence.allfonts.Big5=latin-1,chinese-big5
sequence.allfonts.Big5-HKSCS=latin-1,chinese-big5hkscs
sequence.allfonts.GB18030=latin-1,chinese-gbk,chinese-cn-iso10646
sequence.allfonts.GBK=latin-1,chinese-gbk
sequence.allfonts.GB2312=latin-1,chinese-gb2312
sequence.allfonts.EUC-KR=latin-1,korean
sequence.allfonts.x-euc-jp-linux=latin-1,japanese-x0201,japanese-x0208
sequence.allfonts.UTF-8.ko.KR=latin-1,korean,japanese-x0208,japanese-x0201,chinese-gbk
sequence.allfonts.UTF-8.ja.JP=latin-1,japanese-x0208,japanese-x0201,chinese-gbk,korean
sequence.allfonts.UTF-8.zh.CN=latin-1,chinese-cn-iso10646,japanese-x0208,japanese-x0201,korean
sequence.allfonts.UTF-8.zh.TW=latin-1,chinese-tw-iso10646,japanese-x0208,japanese-x0201,korean
sequence.allfonts.UTF-8.zh.HK=latin-1,chinese-tw-iso10646,japanese-x0208,japanese-x0201,korean

sequence.fallback=lucida,chinese-big5,chinese-gbk,japanese-x0208,korean

# Exclusion Ranges
exclusion.japanese-x0201=0390-03d6,2200-22ef,2701-27be
exclusion.japanese-x0208=0390-03d6,2200-22ef,2701-27be

# Font File Names

filename.-misc-fzmingti-medium-r-normal--*-%d-*-*-p-*-big5-0=/usr/share/fonts/zh_CN/ming_big5.ttf
filename.-misc-fzheiti-medium-r-normal--*-%d-*-*-p-*-big5hkscs-0=/usr/share/fonts/zh_CN/ming_big5.ttf
filename.-misc-fzmingti-medium-r-normal--*-%d-*-*-p-*-iso10646-1=/usr/share/fonts/zh_CN/ming_big5.ttf
filename.-misc-simsun-medium-r-normal--*-%d-*-*-p-*-gbk-0=/usr/share/fonts/zh_CN/simsun.ttc
filename.-misc-simsun-medium-r-normal--*-%d-*-*-p-*-gb2312.1980-0=/usr/share/fonts/zh_CN/simsun.ttc
filename.-misc-simsun-medium-r-normal--*-%d-*-*-p-*-iso10646-1=/usr/share/fonts/zh_CN/simsun.ttc
filename.-hwan-baekmuk_batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0=/usr/share/fonts/zh_CN/batang.ttf
filename.-hwan-baekmuk_gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0=/usr/share/fonts/zh_CN/gulim.ttf
filename.-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=/usr/share/fonts/zh_CN/kochi-gothic.ttf
filename.-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0=/usr/share/fonts/zh_CN/kochi-gothic.ttf
filename.-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=/usr/share/fonts/zh_CN/kochi-mincho.ttf
filename.-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0=/usr/share/fonts/zh_CN/kochi-mincho.ttf

# AWT X11 font paths
awtfontpath.chinese-big5=/usr/share/fonts/simsun
awtfontpath.chinese-big5hkscs=/usr/share/fonts/simsun
awtfontpath.chinese-gb2312=/usr/share/fonts/simsun
awtfontpath.chinese-gbk=/usr/share/fonts/simsun
awtfontpath.chinese-chinese-cn-iso10646=/usr/share/fonts/simsun
awtfontpath.chinese-chinese-tw-iso10646=/usr/share/fonts/simsun
awtfontpath.japanese-x0201=/usr/share/fonts/simsun
awtfontpath.japanese-x0208=/usr/share/fonts/simsun
awtfontpath.korean=/usr/share/fonts/simsun[/code:1]
回复

使用道具 举报

发表于 2005-2-22 08:57:43 | 显示全部楼层
:neutral:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复

使用道具 举报

 楼主| 发表于 2005-2-22 09:08:36 | 显示全部楼层
谢谢BOoRFGOnZ^_^
觉得java显示的字很单薄的说.

昨晚找到一个说明, 已经修改成功了.
http://linux.chinaunix.net/doc/program/2005-01-27/951.shtml
回复

使用道具 举报

发表于 2005-2-22 09:11:36 | 显示全部楼层
java字体的特性就决定对中文支持不好
回复

使用道具 举报

 楼主| 发表于 2005-2-22 09:15:49 | 显示全部楼层
但看见elipsce(怎么拼来着?)和Jbuilder
显示出来的字很漂亮的说.
回复

使用道具 举报

发表于 2005-2-22 11:06:09 | 显示全部楼层
的确可以很漂亮的。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-23 22:28 , Processed in 0.067603 second(s), 17 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表