java中文支援(或亂碼的解決):java程式是跨平台的,但需要解決中文支援問題。
方法很簡單,就是在java安裝目錄下放進去一個中文字型即可。
cd /usr/lib/jvm/java-6-sun/jre/lib/fonts
sudo mkdir fallback
cd fallback
sudo ln -s /usr/share/fonts/truetype/wqy/wqy-zenhei.ttf(把某個中文字型連結進 fallback 目錄,我選了最新的文泉驛夸父字型)
sudo mkfontdir
sudo mkfontscale
對於Java 1.4,其配置有所不同,設定檔名是font.properties,現將其內容附於下:
# %W% %E%
# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
#
# Component Font Mappings For RedhatLinux 8.0/zh_CN
#
serif.0=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1
serif.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
serif.italic.0=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1
serif.italic.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
serif.bold.0=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1
serif.bold.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
serif.bolditalic.0=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1
serif.bolditalic.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
sansserif.0=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1
sansserif.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
sansserif.italic.0=-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1
sansserif.italic.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
sansserif.bold.0=-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1
sansserif.bold.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
sansserif.bolditalic.0=-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1
sansserif.bolditalic.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
monospaced.0=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1
monospaced.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
monospaced.italic.0=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1
monospaced.italic.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
monospaced.bold.0=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1
monospaced.bold.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
monospaced.bolditalic.0=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1
monospaced.bolditalic.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
dialog.0=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1
dialog.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
dialog.italic.0=-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1
dialog.italic.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
dialog.bold.0=-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1
dialog.bold.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
dialog.bolditalic.0=-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1
dialog.bolditalic.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
dialoginput.0=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1
dialoginput.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
dialoginput.italic.0=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1
dialoginput.italic.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
dialoginput.bold.0=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1
dialoginput.bold.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
dialoginput.bolditalic.0=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1
dialoginput.bolditalic.1=-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
# Missing Glyph Character
#
default.char=274f
# Component Font Character Encodings
#
fontcharset.serif.0=sun.io.CharToByteISO8859_1
fontcharset.serif.1=sun.io.CharToByteUnicodeBigUnmarked
fontcharset.sansserif.0=sun.io.CharToByteISO8859_1
fontcharset.sansserif.1=sun.io.CharToByteUnicodeBigUnmarked
fontcharset.monospaced.0=sun.io.CharToByteISO8859_1
fontcharset.monospaced.1=sun.io.CharToByteUnicodeBigUnmarked
fontcharset.dialog.0=sun.io.CharToByteISO8859_1
fontcharset.dialog.1=sun.io.CharToByteUnicodeBigUnmarked
fontcharset.dialoginput.0=sun.io.CharToByteISO8859_1
fontcharset.dialoginput.1=sun.io.CharToByteUnicodeBigUnmarked
# Exclusion Ranges
#
# XFontSet Information
#
fontset.serif.plain=\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.serif.italic=\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1
,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.serif.bold=\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1
,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.serif.bolditalic=\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1
,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.sansserif.plain=\
-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.sansserif.italic=\
-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.sansserif.bold=\
-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.sansserif.bolditalic=\
-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.monospaced.plain=\
-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.monospaced.italic=\
-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.monospaced.bold=\
-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.monospaced.bolditalic=\
-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.dialog.italic=\
-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.dialog.bold=\
-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.dialog.bolditalic=\
-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.dialog.plain=\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1
,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.dialoginput.italic=\
-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.dialoginput.bold=\
-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.dialoginput.bolditalic=\
-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.dialoginput.plain=\
-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
fontset.default=\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1
,\
-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1
filename.-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso8859-1=/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc
filename.-misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1=/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc
appendedfontpath=/usr/share/fonts/wqy-zenhei/
弄好後,將font.properties.*刪除,再看看ConsolePanel裡邊的字是不是好了?