Strategy
Strategy: rendering the Chinese TrueType fonts directly from XFree8 with the
'xtt' module, while preserving the xfs and xft for other applications (i.e,
kde & gnome). So, basically, all modification done in /etc/X11/XF86Config is
enough.
First step test
Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "/export/fonts/TrueType/win_zh_CN.0"
FontPath "unix/:7100"
EndSection
Section "Module"
Load "dbe" # Double-buffering
Load "dri" # Direct rendering infrastructure
# Load "GLcore" # OpenGL support
# Load "glx" # OpenGL X protocol interface
Load "extmod" # Misc. required extensions
# Load "v4l" # Video4Linux, not in default setting
# Load "pex5" # PHIGS for X 3D environment (obsolete)
Load "record" # X event recorder
# Load "xie" # X Image Extension (obsolete)
# You only need the following two modules if you do not use xfs.
# Load "freetype" # TrueType font handler, use xtt instead
Load "xtt" # TrueType font handler
Load "type1" # Adobe Type 1 font handler, not in default setting
Load "fbdevhw"
EndSection
Quit xwindow then start it gain. Note that restarting xwindow manager won't
help.
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 &
Font server Usage
export FONTSERVER
FONTSERVER=unix/:7100
$ xfsinfo
name of server: unix/:7100
version number: 2
vendor string: The X.Org Group
vendor release number: 6510
maximum request size: 16384 longwords (65536 bytes)
number of catalogues: 1
all
Number of alternate servers: 0
number of extensions: 0
Looks
If the default Chinese fonts are rendered through xfs,
TrueType fonts look bad while bitmap fonts looks ok.
xfd -fn '-isas-song ti-medium-r-normal--0-0-72-72-c-0-gb2312.1980-0' &
xfd -fn '-isas-fangsong ti-medium-r-normal--0-0-72-72-c-0-gb2312.1980-0' &
xfd -fn '-isas-song ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0' &
xfd -fn '-isas-fangsong ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0' &
use xfs to render simsun TrueType fonts
chkfontpath --add /opt/lib/X11/fonts/TrueType/win_zh_CN
No changed to /etc/X11/XF86Config-4. I.e.,
Font path is only "unix/:7100", and xtt module is not loaded
the results are the same list of names.
xfd -fn -misc-simsun-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0 &
can only show the first ASCII page, no Chinese fonts shown. I.e.,
next page and previous page buttoms are grayed.
use xtt to render simsun TrueType fonts
chkfontpath --remove /opt/lib/X11/fonts/TrueType/win_zh_CN
Add /opt/lib/X11/fonts/TrueType/win_zh_CN to font path, and load xtt module.
|
!! |
xfs fonts
$ export FONTSERVER=unix/:7100
$ xfsinfo
name of server: unix/:7100
version number: 2
vendor string: The X.Org Group
vendor release number: 6510
maximum request size: 16384 longwords (65536 bytes)
number of catalogues: 1
all
Number of alternate servers: 0
number of extensions: 0
— xfs is not rendering zh_CN TrueType fonts.
xfonts
$ xset -q | grep -A1 "^Font Path:"
Font Path:
/opt/lib/X11/fonts/TrueType/win_zh_CN,unix/:7100
$ xlsfonts | grep sim
-misc-simhei-medium-r-normal--0-0-0-0-p-0-ascii-0
-misc-simhei-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0
-misc-simsun-medium-r-normal--0-0-0-0-p-0-ascii-0
-misc-simsun-medium-r-normal--0-0-0-0-p-0-fcd8859-15
-misc-simsun-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0
-misc-simsun-medium-r-normal--0-0-0-0-p-0-iso8859-1
-misc-simsun-medium-r-normal--0-0-0-0-p-0-iso8859-15
-misc-simsun-medium-r-normal--0-0-0-0-p-0-koi8-r
$ xfd -fn -misc-simsun-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0 &
— can show Chinese fonts. I.e., next page and previous page buttoms work fine.
Adding simsun TrueType fonts to both xfs and xtt
chkfontpath --add /opt/lib/X11/fonts/TrueType/win_zh_CN
And add /opt/lib/X11/fonts/TrueType/win_zh_CN to font path, and load xtt module.
— yield twice as much as. not good
The xfs port under RH7.2
$ grep 7100 /etc/services
xfs 7100/tcp # X font server
$ netstat -a | grep 7100
unix 2 [ ACC ] STREAM LISTENING 1620 /tmp/.font-unix/fs7100
unix 3 [ ] STREAM CONNECTED 2360 /tmp/.font-unix/fs7100
|
The 7100 port is opened locally to system, not to internet. |
Trying History
Using FONTSERVER
FONTSERVER=tcp/unix/:7100
$ fslsfonts
_FSTransSocketINETConnect: Can't get address for unix/
fslsfonts: unable to open server "tcp/unix/:7100"
FONTSERVER=tcp/unix:7100
$ fslsfonts
_FSTransSocketINETConnect: Can't get address for unix
fslsfonts: unable to open server "tcp/unix:7100"
FONTSERVER=tcp/localhost:7100
$ fslsfonts
fslsfonts: unable to open server "tcp/localhost:7100"
$ xfsinfo
xfsinfo: unable to open server "tcp/localhost:7100"
Not using FONTSERVER
unset FONTSERVER
$ xfsinfo -server localhost:7100
xfsinfo: unable to open server "localhost:7100"
Try again
$ xfsinfo -server localhost:7100
xfsinfo: unable to open server "localhost:7100"
$ xfsinfo -server unix/:7100
name of server: unix/:7100
version number: 2
vendor string: The X.Org Group
vendor release number: 6510
maximum request size: 16384 longwords (65536 bytes)
number of catalogues: 1
all
Number of alternate servers: 0
number of extensions: 0
$ xfsinfo -server unix:7100
_FSTransSocketINETConnect: Can't get address for unix
xfsinfo: unable to open server "unix:7100"