由于只有中国大陆区域的用户碰到此类问题,因此其他区域对应的font.properties*文件应该没有问题。经过和font.properties文件的对比,可以看出font.properties.zh中究竟哪里出了问题——组合字体映射部分(Component Font Mappings)中对于每种字体的粗体和斜体,都映射到了常规字体,而没有映射到相应的粗体和斜体,由此导致了JB等应用程序在对粗体或者斜体字符所占宽度计算时,是按照常规字体的宽度进行的,进而导致了光标的显示位置和实际位置不符。如dialoginput.bold.0,对应于字体为Courier New,粗体英文字母,正确的映射应该是dialoginput.bold.0=Courier New Bold,ANSI_CHARSET,而在font.properties.zh中映射为dialoginput.bold.0=Courier New,ANSI_CHARSET(注:没有bold)。
针对这种情况,可以对font.properties.zh进行修改,将所有不正确的映射分别加上bold,Italic或者bold Italic。这样JB和其他Java程序就不会有光标错位的问题了。
还应注意的是,真正与中国大陆地区对应的font.properties文件名应为font.properties.zh_CN,由于JRE中默认没有这个文件,因此会使用范围最接近的文件font.properties.zh。所以如果<jre_dir>/lib/下有font.properties.zh_CN,则应优先修改该文件。另外,font.properties.zh.98文件可能是Windows 9X系统中所使用的,因此如果操作系统为Windows 9X,应修改该文件。
附修改后的font.properties.zh文件内容:
# @(#)font.properties.zh 1.10 02/03/07
#
# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
# Modified by Yue Feng. 11/24/2003
# Component Font Mappings
#
dialog.plain.0=Arial,ANSI_CHARSET
dialog.plain.1=u5b8bu4f53,GB2312_CHARSET
dialog.plain.2=WingDings,SYMBOL_CHARSET
dialog.plain.3=Symbol,SYMBOL_CHARSET
dialog.bold.0=Arial Bold,ANSI_CHARSET
dialog.bold.1=u5b8bu4f53,GB2312_CHARSET
dialog.bold.2=WingDings,SYMBOL_CHARSET
dialog.bold.3=Symbol,SYMBOL_CHARSET
dialog.italic.0=Arial Italic,ANSI_CHARSET
dialog.italic.1=u5b8bu4f53,GB2312_CHARSET
dialog.italic.2=WingDings,SYMBOL_CHARSET
dialog.italic.3=Symbol,SYMBOL_CHARSET
dialog.bolditalic.0=Arial Bold Italic,ANSI_CHARSET
dialog.bolditalic.1=u5b8bu4f53,GB2312_CHARSET
dialog.bolditalic.2=WingDings,SYMBOL_CHARSET
dialog.bolditalic.3=Symbol,SYMBOL_CHARSET 数据挖掘实验室
dialoginput.0=Courier New,ANSI_CHARSET
dialoginput.1=u5b8bu4f53,GB2312_CHARSET
dialoginput.2=WingDings,SYMBOL_CHARSET
dialoginput.3=Symbol,SYMBOL_CHARSET
dialoginput.plain.0=Courier New,ANSI_CHARSET
dialoginput.plain.1=u5b8bu4f53,GB2312_CHARSET
dialoginput.plain.2=WingDings,SYMBOL_CHARSET
dialoginput.plain.3=Symbol,SYMBOL_CHARSET
dialoginput.bold.0=Courier New Bold,ANSI_CHARSET
dialoginput.bold.1=u5b8bu4f53,GB2312_CHARSET
dialoginput.bold.2=WingDings,SYMBOL_CHARSET
dialoginput.bold.3=Symbol,SYMBOL_CHARSET
dialoginput.italic.0=Courier New Italic,ANSI_CHARSET
dialoginput.italic.1=u5b8bu4f53,GB2312_CHARSET
dialoginput.italic.2=WingDings,SYMBOL_CHARSET
dialoginput.italic.3=Symbol,SYMBOL_CHARSET
dialoginput.bolditalic.0=Courier New Bold Italic,ANSI_CHARSET
dialoginput.bolditalic.1=u5b8bu4f53,GB2312_CHARSET
dialoginput.bolditalic.2=WingDings,SYMBOL_CHARSET
dialoginput.bolditalic.3=Symbol,SYMBOL_CHARSET
serif.plain.0=Times New Roman,ANSI_CHARSET
serif.plain.1=u5b8bu4f53,GB2312_CHARSET
serif.plain.2=WingDings,SYMBOL_CHARSET
serif.plain.3=Symbol,SYMBOL_CHARSET
serif.bold.0=Times New Roman Bold,ANSI_CHARSET
serif.bold.1=u5b8bu4f53,GB2312_CHARSET
serif.bold.2=WingDings,SYMBOL_CHARSET
serif.bold.3=Symbol,SYMBOL_CHARSET
serif.italic.0=Times New Roman Italic,ANSI_CHARSET
serif.italic.1=u5b8bu4f53,GB2312_CHARSET
serif.italic.2=WingDings,SYMBOL_CHARSET
serif.italic.3=Symbol,SYMBOL_CHARSET
serif.bolditalic.0=Times New Roman Bold Italic,ANSI_CHARSET
serif.bolditalic.1=u5b8bu4f53,GB2312_CHARSET
serif.bolditalic.2=WingDings,SYMBOL_CHARSET
serif.bolditalic.3=Symbol,SYMBOL_CHARSET
sansserif.plain.0=Arial,ANSI_CHARSET
sansserif.plain.1=u5b8bu4f53,GB2312_CHARSET
sansserif.plain.2=WingDings,SYMBOL_CHARSET
sansserif.plain.3=Symbol,SYMBOL_CHARSET
sansserif.bold.0=Arial Bold,ANSI_CHARSET
sansserif.bold.1=u5b8bu4f53,GB2312_CHARSET
sansserif.bold.2=WingDings,SYMBOL_CHARSET
sansserif.bold.3=Symbol,SYMBOL_CHARSET
sansserif.italic.0=Arial Italic,ANSI_CHARSET
sansserif.italic.1=u5b8bu4f53,GB2312_CHARSET
sansserif.italic.2=WingDings,SYMBOL_CHARSET
sansserif.italic.3=Symbol,SYMBOL_CHARSET
sansserif.bolditalic.0=Arial Bold Italic,ANSI_CHARSET
sansserif.bolditalic.1=u5b8bu4f53,GB2312_CHARSET
sansserif.bolditalic.2=WingDings,SYMBOL_CHARSET
sansserif.bolditalic.3=Symbol,SYMBOL_CHARSET
monospaced.0=Courier New,ANSI_CHARSET
monospaced.plain.1=u5b8bu4f53,GB2312_CHARSET
monospaced.plain.2=WingDings,SYMBOL_CHARSET
monospaced.plain.3=Symbol,SYMBOL_CHARSET
monospaced.bold.0=Courier New Bold,ANSI_CHARSET
monospaced.bold.1=u5b8bu4f53,GB2312_CHARSET
monospaced.bold.2=WingDings,SYMBOL_CHARSET
monospaced.bold.3=Symbol,SYMBOL_CHARSET
monospaced.italic.0=Courier New Italic,ANSI_CHARSET 数据挖掘研究院
monospaced.italic.1=u5b8bu4f53,GB2312_CHARSET
monospaced.italic.2=WingDings,SYMBOL_CHARSET
monospaced.italic.3=Symbol,SYMBOL_CHARSET
monospaced.bolditalic.0=Courier New Bold Italic,ANSI_CHARSET
monospaced.bolditalic.1=u5b8bu4f53,GB2312_CHARSET
monospaced.bolditalic.2=WingDings,SYMBOL_CHARSET
monospaced.bolditalic.3=Symbol,SYMBOL_CHARSET
# Font File Names
#
filename.u5b8bu4f53=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
# Missing Glyph Character
#
default.char=2751
# Component Font Character Encodings
#
fontcharset.dialog.1=sun.io.CharToByteGBK
fontcharset.dialog.2=sun.awt.windows.CharToByteWingDings
fontcharset.dialog.3=sun.awt.CharToByteSymbol
fontcharset.dialoginput.1=sun.io.CharToByteGBK
fontcharset.dialoginput.2=sun.awt.windows.CharToByteWingDings
fontcharset.dialoginput.3=sun.awt.CharToByteSymbol
fontcharset.serif.1=sun.io.CharToByteGBK
fontcharset.serif.2=sun.awt.windows.CharToByteWingDings
fontcharset.serif.3=sun.awt.CharToByteSymbol
fontcharset.sansserif.1=sun.io.CharToByteGBK
fontcharset.sansserif.2=sun.awt.windows.CharToByteWingDings
fontcharset.sansserif.3=sun.awt.CharToByteSymbol
fontcharset.monospaced.0=sun.io.CharToByteGBK
fontcharset.monospaced.1=sun.io.CharToByteGBK
fontcharset.monospaced.2=sun.awt.windows.CharToByteWingDings
fontcharset.monospaced.3=sun.awt.CharToByteSymbol
# Exclusion Ranges
#
exclusion.dialog.0=0100-20ab,20ad-f8ff
exclusion.dialoginput.0=0100-20ab,20ad-f8ff
exclusion.serif.0=0100-20ab,20ad-f8ff
exclusion.sansserif.0=0100-20ab,20ad-f8ff
exclusion.monospaced.0=0100-20ab,20ad-f8ff
# Text Input Character Set
#
inputtextcharset=GB2312_CHARSET
需要说明一点,JB使用的是自己带的JRE,而不是系统中的JRE,所以要修改JB安装目录下jdk目录中jre/lib中的font.properties文件才有效。

