Chinese TrueType fonts trial and errors 

xmms fonts 

Xmms does not have a menu font configuration.

  • The menu font will be very big once switching to viewing Chinese
  • Changing the mainwin_font to westen fonts won't help
  • Chinese song names are only visable if I launch xmms with LANG=zh_CN
  • If I start xmms as is (no LANG), the Chinese characters will be missing

xmms fonts 

The actual environment variable that make the vital effect is LC_CTYPE. LC_CTYPE=zh_CN or not determines whether xmms can show Chinese characters or not. But there is an annoying side effect also. The xmms menu changed also. trying to affect xmms menu font by other environment variables won't work.

xmms fonts 

man locale

LC_CTYPE
        Character classification and case conversion.
LC_MESSAGES
        Formats of informative and diagnostic messages and
        interactive responses.

gb2312.1980 is not enough 

Error returned from xmms:

The font "-microsoft-simsun-medium-r-normal-*-*-100-*-*-c-*-gb2312.1980-0"
does not support all the required character sets for the current locale "C"
  (Missing character set "ISO8859-1")

adding "-microsoft-simsun-medium-r-normal—0-0-0-0-c-0-iso8859-1" into fonts.dir solved the problem.

xtt for xfs 

Goal 

Try to use xfs to render Chinese TrueType fonts through 'xtt for xfs'. Note this practice has been proved to be a failure to render Chinese TrueType fonts.

Status check, before the change 

FONTSERVER=unix/:7100 fslsfonts | grep sim

— empty at first

% xlsfonts | grep sim
-misc-simhei-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
-misc-simhei-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0
-misc-simsun-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
-misc-simsun-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0

— none-empty at first

Action: remove fonts from Xfree86 and add to xfs 

xset -fp /export/fonts/TrueType/win_zh_CN/
xlsfonts | grep sim

— empty now

chkfontpath --add /export/fonts/TrueType/win_zh_CN0/

Status check, after the change 

% FONTSERVER=unix/:7100 fslsfonts | grep microsoft
-microsoft-simhei-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
-microsoft-simhei-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0
-microsoft-simsun-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
-microsoft-simsun-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0
xfd -fn -microsoft-simsun-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0 &
xfd -fn -microsoft-simsun-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0 &

Adding the /export/fonts/TrueType/win_zh_CN/ to xfs will not work, because xfs changes the file "fonts.dir" by all means.

Only gb2312.1980 works 

Tried to change the 'gb2312.1980' to 'gb18030', then rxvt failed to show Chinese any more.

Chinese TrueType fonts won't work with xfs 

xfs always rewrite the fonts.dir file 

% cat fonts.dir
6
simhei.ttf -microsoft-SimHei-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
simkai.ttf -microsoft-KaiTi_GB2312-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
simsun.ttf -microsoft-SimSun-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
simhei.ttf -microsoft-SimHei-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0
simkai.ttf -microsoft-KaiTi_GB2312-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0
simsun.ttf -microsoft-SimSun-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0

chmod 444 fonts.dir

% dirdir . fonts.*
dr-xr-xr-x    2 root     root         4096 Nov  3 15:42 ./
-r--r--r--    1 root     root          422 Nov  3 16:01 fonts.dir
lrwxrwxrwx    1 root     root            9 Nov  3 15:39 fonts.scale -> fonts.dir

/etc/rc.d/init.d/xfs restart

% dirdir . fonts.*
dr-xr-xr-x    2 root     root         4096 Nov  3 16:02 ./
-rw-r--r--    1 root     root          641 Nov  3 16:02 fonts.dir
lrwxrwxrwx    1 root     root            9 Nov  3 15:39 fonts.scale -> fonts.dir

— xfs writes over the readonly file "fonts.dir" in the readonly directory!

Chinese TrueType fonts reconized by xfs can't be used 

Try to use whatever fonts reconized by xfs, as long as we know it is the one.

% xlsfonts | grep sim
-misc-simhei-medium-r-normal--0-0-0-0-c-0-ascii-0
-misc-simhei-medium-r-normal--0-0-0-0-c-0-iso10646-1
-misc-simsun-medium-r-normal--0-0-0-0-c-0-ascii-0
-misc-simsun-medium-r-normal--0-0-0-0-c-0-fcd8859-15
-misc-simsun-medium-r-normal--0-0-0-0-c-0-iso10646-1
-misc-simsun-medium-r-normal--0-0-0-0-c-0-iso8859-1
-misc-simsun-medium-r-normal--0-0-0-0-c-0-iso8859-15
-misc-simsun-medium-r-normal--0-0-0-0-c-0-koi8-r
% LANG=zh_CN rxvt -sl 1500 -bg black -fg gray75 -fn 7x14 -km gb -fm -misc-simsun-medium-r-normal--0-0-0-0-c-0-iso10646-1

'date' result is wrong.

% LANG=zh_CN rxvt -sl 1500 -bg black -fg gray75 -fn 7x14 -km gb -fm -misc-simsun-medium-r-normal--0-0-0-0-c-0-iso8859-1

— not cc fonts at all for 'date'

Niether the iso10646, nor the iso8859 can be use by rxvt to show Chinese.