Java 與中文

系统字体配置、中文显示和输入法问题
回复
d9169037
帖子: 9
注册时间: 2005-06-03 11:28
送出感谢: 0
接收感谢: 0

Java 與中文

#1

帖子 d9169037 » 2005-07-19 18:46

請問各位前輩, 小弟安裝的是 vera 圓體字型, 不知道有沒有辦法把他設定為 Java 的中文預設字型, 感謝各位!
头像
xiaosir
帖子: 46
注册时间: 2005-07-16 7:34
来自: 中国广东
送出感谢: 0
接收感谢: 0

#2

帖子 xiaosir » 2005-07-19 20:57

在java安装目录下有字体配置文件,
进行字体替换就可以了,
无聊的人越来越多,无聊的讨论越来越多
头像
oneleaf
论坛管理员
帖子: 10226
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04
送出感谢: 7 次
接收感谢: 103 次

#3

帖子 oneleaf » 2005-07-19 21:01

sudo -s -H
cd /usr/lib/j2sdk1.5-sun/jre/lib
cp fontconfig.RedHat.3.properties.src fontconfig.properties
gedit fontconfig.properties

修改为:
allfonts.chinese-gb18030=-misc-vera sans yuanti-medium-r-normal--*-%d-*-*-*-*-iso10646-1
allfonts.chinese-gb18030.motif=-misc-vera sans yuanti-medium-r-normal--*-%d-*-*-*-*-gb2312.1980-0
allfonts.chinese-big5=-misc-vera sans yuanti-medium-r-normal--*-%d-*-*-*-*-iso10646-1
allfonts.chinese-big5.motif=-misc-vera sans yuanti-medium-r-normal--*-%d-*-*-*-*-gb18030.2000-0

在后面加入字体的路径:
filename.-misc-vera sans yuanti-medium-r-normal--*-%d-*-*-*-*-iso10646-1=/usr/share/fonts/VeraSansYuanTi/VeraSansYuanTi-Regular.ttf
filename.-misc-vera sans yuanti-medium-r-normal--*-%d-*-*-*-*-gb2312.1980-0=/usr/share/fonts/VeraSansYuanTi/VeraSansYuanTi-Regular.ttf
filename.-misc-vera sans yuanti-medium-r-normal--*-%d-*-*-*-*-gb18030.2000-0=/usr/share/fonts/VeraSansYuanTi/VeraSansYuanTi-Regular.ttf
当净其意如虚空,远离妄想及诸取,令心所向皆无碍
d9169037
帖子: 9
注册时间: 2005-06-03 11:28
送出感谢: 0
接收感谢: 0

#4

帖子 d9169037 » 2005-07-19 21:06

感謝各位前輩的指點, 小弟回家後馬上測試看看, 謝謝!! :D
d9169037
帖子: 9
注册时间: 2005-06-03 11:28
送出感谢: 0
接收感谢: 0

#5

帖子 d9169037 » 2005-07-19 21:53

小弟稍微測試了一下, 發現還是沒辦法顯示中文, 不過還是謝謝前輩的指教.
头像
xiaosir
帖子: 46
注册时间: 2005-07-16 7:34
来自: 中国广东
送出感谢: 0
接收感谢: 0

#6

帖子 xiaosir » 2005-07-21 13:19

d9169037 写了:小弟稍微測試了一下, 發現還是沒辦法顯示中文, 不過還是謝謝前輩的指教.
没问题的,不管1.5,1.4都能让你中文出来。
无聊的人越来越多,无聊的讨论越来越多
头像
id_sonic
帖子: 339
注册时间: 2005-04-08 18:08
来自: Chongqing
送出感谢: 0
接收感谢: 0
联系:

#7

帖子 id_sonic » 2005-10-02 16:24

正确,不过我只用 ar pl new sung

所以 fontconfig.properties 文件就应该 是这个样子的

代码: 全选

# @(#)linux.fontconfig.RedHat.3.properties	1.1 03/12/10
#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
#

# Version

version=1

# Component Font Mappings

#allfonts.chinese-gb18030=-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
#allfonts.chinese-gb18030.motif=-isas-song ti-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0
#allfonts.chinese-big5=-arphic technology co.-ar pl mingti2l big5-medium-r-normal--*-%d-*-*-c-*-iso10646-1
#allfonts.chinese-big5.motif=-taipei-fixed-medium-r-normal--*-%d-*-*-c-*-big5-0
#allfonts.lucida=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1

############ 这里使用的是 ar pl new sung #########

allfonts.chinese-gb18030=-misc-ar pl new sung-medium-r-normal--*-%d-*-*-*-*-iso10646-1
allfonts.chinese-gb18030.motif=-misc-ar pl new sung-medium-r-normal--*-%d-*-*-*-*-gb2312.1980-0 
allfonts.chinese-big5=-misc-ar pl new sung-medium-r-normal--*-%d-*-*-*-*-iso10646-1 
allfonts.chinese-big5.motif=-misc-ar pl new sung-medium-r-normal--*-%d-*-*-*-*-gb18030.2000-0

############  ar pl new sung 字体配置结束 ########

serif.plain.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.plain.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
serif.plain.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.bold.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
serif.bold.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.italic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
serif.italic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.bolditalic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
serif.bolditalic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.plain.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1
sansserif.plain.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.bold.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1
sansserif.bold.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.italic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1
sansserif.italic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.bolditalic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1
sansserif.bolditalic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.plain.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
monospaced.plain.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.bold.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
monospaced.bold.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.italic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
monospaced.italic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.bolditalic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
monospaced.bolditalic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.plain.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialog.plain.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.bold.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialog.bold.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.italic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialog.italic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.bolditalic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialog.bolditalic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.plain.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialoginput.plain.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.bold.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialoginput.bold.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.italic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialoginput.italic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.bolditalic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialoginput.bolditalic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-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.x-euc-jp-linux=latin-1,japanese-x0208
sequence.allfonts.EUC-KR=latin-1,korean
sequence.allfonts.GB18030=latin-1,chinese-gb18030
sequence.fallback=lucida,chinese-big5,chinese-gb18030,japanese-x0208,korean

# Exclusion Ranges

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

# Font File Names

filename.-arphic_technology_co.-ar_pl_mingti2l_big5-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/zh_TW/TrueType/bsmi00lp.ttf
filename.-misc-baekmuk_batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/ko/TrueType/batang.ttf
filename.-misc-baekmuk_gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/ko/TrueType/gulim.ttf
filename.-misc-kochi_gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=/usr/share/fonts/ja/TrueType/kochi-gothic-subst.ttf
filename.-misc-kochi_mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=/usr/share/fonts/ja/TrueType/kochi-mincho-subst.ttf
filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/zh_CN/TrueType/zysong.ttf

# AWT X11 font paths
awtfontpath.latin-1=/usr/X11R6/lib/X11/fonts/Type1
awtfontpath.chinese-big5=/usr/share/fonts/zh_TW/TrueType
awtfontpath.chinese-gb18030=/usr/share/fonts/zh_CN/TrueType
awtfontpath.japanese-x0208=/usr/share/fonts/ja/TrueType
awtfontpath.korean=/usr/share/fonts/ko/TrueType

#########加入文件路径的中文支持############
filename.-misc-ar pl new sung-medium-r-normal--*-%d-*-*-*-*-iso10646-1=/usr/share/fonts/truetype/fireflysung.ttf
filename.-misc-ar pl new sung-medium-r-normal--*-%d-*-*-*-*-gb2312.1980-0=/usr/share/fonts/truetype/fireflysung.ttf
filename.-misc-ar pl new sung-medium-r-normal--*-%d-*-*-*-*-gb18030.2000-0=/usr/share/fonts/truetype/fireflysung.ttf

目前是 tinkpad r400 上的 debian 用户
my blog Trust Dating
回复

回到 “字体美化和中文支持”