Java开发网 |
注册 |
登录 |
帮助 |
搜索 |
排行榜 |
发帖统计
|
您没有登录 |
» Java开发网 » Java SE 综合讨论区
打印话题 寄给朋友 订阅主题 |
作者 | [IDE]JBuilder,IdeaJ等Java开发工具中文字体显示的问题? |
hawker
CJSDN高级会员 发贴: 222 积分: 50 |
于 2002-12-10 15:09
JBuilder,IdeaJ 等Java开发工具中文字体显示的问题 我们使用JBuilder,IdeaJ和其他的集成开发环境,都遇到过中文字体显示的问题,有的人将字号设置成奇数,有的人将字体进行修改,都不能解决根本问题。通过仔细研究JRE中关于中文字体配置文件,发现这些问题的关键是这些工具所依赖的JRE中关于中文字体设计的配置文件存在问题,造成依赖它的应用程序显示不正确。 在Windows 2000/xp系统中,宋体的字体名称是simsun.ttc,可是在font.properties.zh中关于宋体的字体文件名称却是simsun.ttf,这种配置在windows 98/me下面没有问题,但是在2000/xp下面,中文的文字就会显示为方块了。 在font.properties.zh中,逻辑字体的斜体,加重所对应的实际字体在font.properties.zh中也没用正确配置,造成我们在java程序中进行编辑时,插入的实际位置和光标的位置不一致,这是我们只能将IDE工具的字体设置成宋体,并且将字体字号设置成奇数进行解决(Borland的技术攻势就推荐这种方法),在IdeaJ中,我们将所有的字体加重属性去掉,也能解决问题。但是这种解决方法不能根本解决问题,当工具出现新的版本时,还可能出现新的问题。 最好的解决方法是修改font.properties.zh文件,正确配置相关平台的字体的逻辑字体和物理字体的对应关系。下面是我修改的font.properties.zh文件,将它使用文本编辑程序保存到IDE工具使用的JRE的lib目录,中文显示问题可以解决,这个文件在Windows 2000 , JDK 1.4.1_01, JBuilder 7/8, IDEAJ 3.0下测试通过。 # Begin of font.properties.zh # # # @(#)font.properties.zh # save it to %JRE%/lib/font.properties.zh # # @edit by Hakwer hao (hhao99@yahoo.com.cn) # @ Dec-06-2002 # # AWT Font default Properties for Chinese Windows # dialog.plain.0=Arial,ANSI_CHARSET dialog.plain.1=\u5b8b\u4f53,GB2312_CHARSET dialog.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED dialog.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED dialog.bold.0=Arial Bold,ANSI_CHARSET dialog.bold.1=\u5b8b\u4f53,GB2312_CHARSET dialog.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED dialog.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED dialog.italic.0=Arial Italic,ANSI_CHARSET dialog.italic.1=\u5b8b\u4f53,GB2312_CHARSET dialog.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED dialog.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED dialog.bolditalic.0=Arial Bold Italic,ANSI_CHARSET dialog.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSET dialog.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED dialog.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED dialoginput.plain.0=Courier New,ANSI_CHARSET dialoginput.plain.1=\u5b8b\u4f53,GB2312_CHARSET dialoginput.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED dialoginput.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED dialoginput.bold.0=Courier New Bold,ANSI_CHARSET dialoginput.bold.1=\u5b8b\u4f53,GB2312_CHARSET dialoginput.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED dialoginput.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED dialoginput.italic.0=Courier New Italic,ANSI_CHARSET dialoginput.italic.1=\u5b8b\u4f53,GB2312_CHARSET dialoginput.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED dialoginput.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED dialoginput.bolditalic.0=Courier New Bold Italic,ANSI_CHARSET dialoginput.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSET dialoginput.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED dialoginput.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED serif.plain.0=Times New Roman,ANSI_CHARSET serif.plain.1=\u5b8b\u4f53,GB2312_CHARSET serif.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED serif.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED serif.bold.0=Times New Roman Bold,ANSI_CHARSET serif.bold.1=\u5b8b\u4f53,GB2312_CHARSET serif.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED serif.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED serif.italic.0=Times New Roman Italic,ANSI_CHARSET serif.italic.1=\u5b8b\u4f53,GB2312_CHARSET serif.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED serif.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED serif.bolditalic.0=Times New Roman Bold Italic,ANSI_CHARSET serif.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSET serif.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED serif.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED sansserif.plain.0=Arial,ANSI_CHARSET sansserif.plain.1=\u5b8b\u4f53,GB2312_CHARSET sansserif.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED sansserif.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED sansserif.bold.0=Arial Bold,ANSI_CHARSET sansserif.bold.1=\u5b8b\u4f53,GB2312_CHARSET sansserif.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED sansserif.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED sansserif.italic.0=Arial Italic,ANSI_CHARSET sansserif.italic.1=\u5b8b\u4f53,GB2312_CHARSET sansserif.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED sansserif.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED sansserif.bolditalic.0=Arial Bold Italic,ANSI_CHARSET sansserif.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSET sansserif.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED sansserif.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED monospaced.plain.0=Courier New,GB2312_CHARSET monospaced.plain.1=\u5b8b\u4f53,GB2312_CHARSET monospaced.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED monospaced.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED monospaced.bold.0=Courier New Bold,GB2312_CHARSET monospaced.bold.1=\u5b8b\u4f53,GB2312_CHARSET monospaced.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED monospaced.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED monospaced.italic.0=Courier New Italic,GB2312_CHARSET monospaced.italic.1=\u5b8b\u4f53,GB2312_CHARSET monospaced.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED monospaced.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED monospaced.bolditalic.0=Courier New Bold Italic,GB2312_CHARSET monospaced.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSET monospaced.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED monospaced.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED # name aliases # alias.timesroman=serif alias.helvetica=sansserif alias.courier=monospaced # for backward compatibility #timesroman.0=Times New Roman,ANSI_CHARSET #helvetica.0=Arial,ANSI_CHARSET #courier.0=Courier New,ANSI_CHARSET zapfdingbats.0=WingDings,SYMBOL_CHARSET # font filenames for reduced initialization time # filename.\u5b8b\u4f53=SIMSUN.TTC filename.Arial=ARIAL.TTF filename.Arial_Bold=ARIALBD.TTF filename.Arial_Italic=ARIALI.TTF filename.Arial_Bold_Italic=ARIALBI.TTF filename.Courier_New=COUR.TTF filename.Courier_New_Bold=COURBD.TTF filename.Courier_New_Italic=COURI.TTF filename.Courier_New_Bold_Italic=COURBI.TTF filename.Times_New_Roman=TIMES.TTF filename.Times_New_Roman_Bold=TIMESBD.TTF filename.Times_New_Roman_Italic=TIMESI.TTF filename.Times_New_Roman_Bold_Italic=TIMESBI.TTF filename.WingDings=WINGDING.TTF filename.Symbol=SYMBOL.TTF # Default font definition # default.char=2751 # Static FontCharset info. # #fontcharset.dialog.0=sun.io.CharToByteCp1252 fontcharset.dialog.1=sun.io.CharToByteGBK fontcharset.dialog.2=sun.awt.windows.CharToByteWingDings fontcharset.dialog.3=sun.awt.CharToByteSymbol #fontcharset.dialoginput.0=sun.io.CharToByteCp1252 fontcharset.dialoginput.1=sun.io.CharToByteGBK fontcharset.dialoginput.2=sun.awt.windows.CharToByteWingDings fontcharset.dialoginput.3=sun.awt.CharToByteSymbol #fontcharset.serif.0=sun.io.CharToByteCp1252 fontcharset.serif.1=sun.io.CharToByteGBK fontcharset.serif.2=sun.awt.windows.CharToByteWingDings fontcharset.serif.3=sun.awt.CharToByteSymbol #fontcharset.sansserif.0=sun.io.CharToByteCp1252 fontcharset.sansserif.1=sun.io.CharToByteGBK fontcharset.sansserif.2=sun.awt.windows.CharToByteWingDings fontcharset.sansserif.3=sun.awt.CharToByteSymbol #fontcharset.monospaced.0=sun.io.CharToByteCp1252 fontcharset.monospaced.1=sun.io.CharToByteGBK fontcharset.monospaced.2=sun.awt.windows.CharToByteWingDings fontcharset.monospaced.3=sun.awt.CharToByteSymbol # Exclusion Range info. # exclusion.dialog.plain.0=00a0-f8ff exclusion.dialog.italic.0=00a0-f8ff exclusion.dialog.bold.0=00a0-f8ff exclusion.dialog.bolditalic.0=00a0-f8ff exclusion.dialoginput.plain.0=00a0-f8ff exclusion.dialoginput.italic.0=00a0-f8ff exclusion.dialoginput.bold.0=00a0-f8ff exclusion.dialoginput.bolditalic.0=00a0-f8ff exclusion.serif.plain.0=00a0-f8ff exclusion.serif.italic.0=00a0-f8ff exclusion.serif.bold.0=00a0-f8ff exclusion.serif.bolditalic.0=00a0-f8ff exclusion.sansserif.plain.0=00a0-f8ff exclusion.sansserif.italic.0=00a0-f8ff exclusion.sansserif.bold.0=00a0-f8ff exclusion.sansserif.bolditalic.0=00a0-f8ff exclusion.monospaced.plain.0=00a0-f8ff exclusion.monospaced.italic.0=00a0-f8ff exclusion.monospaced.bold.0=00a0-f8ff exclusion.monospaced.bolditalic.0=00a0-f8ff # charset for text input # inputtextcharset=GB2312_CHARSET # # @ end of font.properties.zh # font.properties.zh (7.13k)
zua edited on 2004-09-13 12:08
我有一点感想和初学者们同享(原创) |
话题树型展开 |
人气 | 标题 | 作者 | 字数 | 发贴时间 |
3837 | [IDE]JBuilder,IdeaJ等Java开发工具中文字体显示的问题? | hawker | 8263 | 2002-12-10 15:09 |
已读帖子 新的帖子 被删除的帖子 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |