Set a font server in RH 

Use it 

export FONTSERVER=tcp/sunny:7100
xset fp+ $FONTSERVER
xset -q

Action 

Client side 

export FONTSERVER=tcp/sunny.acadiau.ca:7100
fsinfo
fslsfonts | do_waitp
xset fp= $FONTSERVER
cat ~/tmp/cc.txt

History 

$ psbn xfs
xfs        665     1  0 Apr30 ?        00:00:00 xfs -droppriv -daemon -port -1
kill -1 665
$ psbn xfs
xfs        665     1  0 Apr30 ?        00:00:00 xfs -droppriv -daemon -port -1

— still there, not restarted

kill 665

— ok, gone

local test 
xfs -droppriv -daemon
% fsinfo -s localhost:7100
name of server: localhost:7100
version number: 2
vendor string:  X Consortium
vendor release number:  6300
maximum request size:   16384 longwords (65536 bytes)
number of catalogues:   1
        all
Number of alternate servers: 0
number of extensions:   0
FONTSERVER=tcp/localhost:7100; export FONTSERVER
fsinfo
fslsfonts | do_waitp
# launch new xterm
xset fp= tcp/localhost:7100
cd ~/tmp
cat cc.txt

— no chinese!

Try other windows, also no chinese!

use xset -q to query the fontpath, all window's fontpath have been changed to tcp/localhost:7100!

So, xset is not only limited to the current xwindow. It operates on the entire x-window system!

So, should really use xset -q to see previous value first!

get it 
fsinfo -s sunny:7100
pre-verify 
cd tmp
cat cc.txt
xset -q
xset fp= /usr/share/zhfont/TTF/,/usr/share/zhfont/TTF/:unscaled,/usr/share/zhfont/X11/,/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/75dpi/:unscaled,/usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/Speedo/,/usr/X11R6/lib/X11/fonts/75dpi/
xset -q
font verify 
xlsfonts | fcols '$2 " " $3' - -F - | uniq
xfontsel &

OK:

isas fangsong ti
isas song ti
jis fixed
daewoo gothic
daewoo mincho
studio song

NOK:

cclib
hku
check font server 
FONTSERVER=tcp/localhost:7100; export FONTSERVER
fsinfo
fslsfonts
substitute 
xset fp= tcp/localhost:7100
post-verify 
cat cc.txt

— no Chinese any more! reset font path & do again, ok.

— ok in cxterm!

Test on original x font server 

xset fp= unix/:-1
xset -q
FONTSERVER=unix/:-1; export FONTSERVER
fsinfo
fslsfonts

— quite normal

cat cc.txt

— no Chinese any more! reset font path & do again, ok.

Conclusion 

BP solution does not include getting the fonts from X font server.

Change the startup file 

cd /etc/rc.d/init.d
f-sreplace ' -port -1' '' xfs
% /etc/rc.d/init.d/xfs stop
Shutting down X Font Server:                               [  OK  ]
% /etc/rc.d/init.d/xfs start
Starting X Font Server:                                    [  OK  ]
% chkfontpath
Current directories in font path:
1: /usr/X11R6/lib/X11/fonts/75dpi:unscaled
2: /usr/X11R6/lib/X11/fonts/misc:unscaled
3: /usr/X11R6/lib/X11/fonts/75dpi
4: /usr/X11R6/lib/X11/fonts/PEX
5: /usr/X11R6/lib/X11/fonts/Speedo
6: /usr/X11R6/lib/X11/fonts/Type1
7: /usr/X11R6/lib/X11/fonts/encodings
8: /usr/X11R6/lib/X11/fonts/misc
9: /usr/share/fonts/default/Type1
10: /usr/share/fonts/default/ghostscript
11: /usr/share/zhfont/TTF:unscaled
12: /usr/share/zhfont/TTF
13: /usr/share/zhfont/X11
14: /usr/share/zhfont/console

Setup xfs 

http://www.linuxdoc.org/HOWTO/mini/FDU/truetype.html#XFS

Redhat's xfs

As of Redhat Linux 6.0, Redhat based distributions (Mandrake, etc) have included a specially patched version of xfs, the XFree86 Font Server, and patched X servers as well. Redhat's xfs includes the xfsft patch set which in turn is built upon the FreeType Font library. Redhat's xfs provides similar functionality to xfstt. xfs is able to serve both TrueType and Type 1 fonts, as well as legacy X fonts.

If you are using a Redhat based distro, you should have xfs installed already. If not, it is in the XFree86-xfs*rpm. To make sure it runs as one of the default services, either use ntsysv or:

chkconfig --add xfs

Now xfs will start every time you boot.

*Tags*: ntsysv, chkconfig

Truetype fonts in XFree86 4.2.0 

http://www.linuxcompatible.org/forums/viewtopic.php?t=19

I am sure everyone can agree that the standard fonts of XFree are rather crappy. There are many howtos on making them look better, or using other fonts. Here you will find yet another howto, cookbook or whatever you want to call it….

The guys from Redmond have a habit of taking care of the looks quite a bit more than of security and that is actually to our advantage. We can 'borrow' their fonts for use in X. Note that the use of those fonts is only allowed if you have a valid windows license, or if you have downloaded the fonts from their site.

This text assumes you use XFree 4.2.0, that you have a reasonable knowledge of the CLI and *NIX commands, that you have a working setup of X and a reasonably recent distribution. You should also have perl and freetype on your system.

Step 1: Preparing the fonts and the directory. 

Unpack and/or move (from a windows partition) the ttf files to a directory under /usr/X11R6/lib/X11/fonts, for instance Truetype. The fontserver prefers the filenames to be in lowercase, so use this script on the files (I am reasonably sure the use is selfexplanatory?). Download the program ttmkfdir here. Unpack it and put the file ttmkfdir.linuxbin.glibc2 somewhere where you can run it from, such as /usr/local/bin. Then make a symlink to it called ttmkfdir since I am sure you don't want to type all of that every time you use it Next, download this file and also put it in the /usr/local/bin directory. Once you have all that set up, you cd into the directory with the truetype fonts. Run the command: Code:

http://www.fogdeity.com/eduni/systems/unix/fixcase.html http://www.joerg-pommnitz.de/TrueType/ttmkfdir.tar.gz http://home.c2i.net/dark/mkfontalias.py

$ cd /usr/X11/lib/X11/fonts/Truetype
$ chmod u+x /usr/local/bin/mkfontalias.py
$ ttmkfdir -o fonts.scale
$ mkfontdir
$ mkfontalias.py

The "ttmkfdir -o fonts.scale " command creates fonts.scale, which is basically a list of files with their associated filesizes. The fontsizes, I assume, are ignored, but X needs the list of fonts to be able to offer them.

This next command, mkfontdir, creates fonts.dir which is more or less a copy of fonts.scale as far as I can tell. I am sure it has some purpose, and if you know, by all means, enlighten me

After these commands you should see the following files: fonts.alias, fonts.dir and fonts.scale.

Step 2: Modifying the config files. 

Next thing to do is modifying the various configuration files to reflect the new fonts you have added and make the most of them. Go and find the file XF86Config-4 or XF86Config. If both are found, the -4 version gets used. They can usually be found at /etc/X11 or /usr/X11/lib/X11. Open it and look for the following section: Code: Section "Files"

Modify the lines under that section to look like this:

FontPath      "/usr/X11R6/lib/X11/fonts/Type1"
FontPath      "/usr/X11R6/lib/X11/fonts/util"
FontPath      "/usr/X11R6/lib/X11/fonts/misc:unscaled"
FontPath      "/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
FontPath      "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
FontPath      "/usr/X11R6/lib/X11/fonts/Speedo"
FontPath      "/usr/X11R6/lib/X11/fonts/TTF"
FontPath      "/usr/X11R6/lib/X11/fonts/Truetype"
FontPath      "/usr/X11R6/lib/X11/fonts/cyrillic"
FontPath      "/usr/X11R6/lib/X11/fonts/encodings"
RgbPath      "/usr/X11R6/lib/X11/rgb"
ModulePath   "/usr/X11R6/lib/modules"

This will make sure X can find the fonts. By adding the :unscaled at the end of the line, you tell X not to scale the fonts in that directory. Why wouldn't you want to scale them, you ask? Simple: the fonts in that directory are bitmapped fonts, which means that scaling them makes them blocky. Blocky == ugly.

Next, hunt for the file called XftConfig. It can usually be found in the same directory as XF86Config. Look for the line:

dir "/usr/X11R6/lib/X11/fonts/Type1"

Modify the lines there to show: Code:

dir "/usr/X11R6/lib/X11/fonts/Type1"
dir "/usr/X11R6/lib/X11/fonts/TTF"
dir "/usr/X11R6/lib/X11/fonts/TrueType"

This will make sure the fontserver will be able to find the fonts as well.

Step 3: Sit back and enjoy your work. 

Fire up X again and you should be able to see that you now have the use of Truetype fonts in X.

Example 

I am using RH 7.3, OO 1.0.1, and here is my config file as asked for:

# $XFree86: xc/lib/Xft/XftConfig.cpp,v 1.5 2000/12/14 23:03:53 keithp Exp $

dir "/usr/X11R6/lib/X11/fonts/Type1"
dir "/usr/X11R6/lib/X11/fonts/TTF"
dir "/usr/X11R6/lib/X11/fonts/truetype"

# Red Hat additions
dir "/usr/X11R6/lib/X11/fonts/TTF"
dir "/usr/share/fonts/default/TrueType"
dir "/usr/share/fonts/default/Type1"
dir "/usr/share/fonts/ja/TrueType"
dir "/usr/share/fonts/ko/TrueType"
dir "/usr/share/fonts/zh_CN/TrueType"
dir "/usr/share/fonts/zh_TW/TrueType"

#
# alias 'fixed' for 'mono'
#
match any family == "fixed"      edit family =+ "mono";

#
# Don't antialias small fonts
#
match
        any size < 11
        any size > 8
        edit antialias=false;

#
# Don't antialias wingding symbols and similar types of symbol fontsets
#
match
        any family == "webdings"
        edit antialias = false;
        encoding += "glyphs-fontspecific";
match
        any family == "wingdings"
        edit antialias = false;
        encoding += "glyphs-fontspecific";

#
# Check users config file
#
includeif   "~/.xftconfig"

#
# Use Luxi fonts for default faces
#
match any family == "serif"      edit family += "Luxi Serif";
match any family == "sans"      edit family += "Luxi Sans";
match any family == "mono"      edit family += "Luxi Mono";

#
# Alias between XLFD families and font file family name, prefer local
# fonts
#
match any family == "charter"      edit family += "bitstream charter";
match any family == "bitstream charter" edit family =+ "charter";

#
# Alias older name for Luxi fonts
#
match any family == "LuciduxSerif"   edit family += "Luxi Serif";
match any family == "Lucidux Serif"   edit family += "Luxi Serif";

match any family == "LuciduxSans"   edit family += "Luxi Sans";
match any family == "Lucidux Sans"   edit family += "Luxi Sans";

match any family == "LuciduxMono"   edit family += "Luxi Mono";
match any family == "Lucidux Mono"   edit family += "Luxi Mono";

#
# TrueType font aliases (disabled - experimental)
#
#match any family == "Comic Sans"        edit family += "Comic Sans MS";
#match any family == "Comic Sans MS"     edit family =+ "Comic Sans";
#match any family == "Trebuchet"         edit family += "Trebuchet MS";
#match any family == "Trebuchet MS"      edit family =+ "Trebuchet";
#match any family == "Monotype"          edit family =+ "Monotype.com";
#match any family == "Andale Mono"       edit family += "Monotype.com";
#match any family == "Monotype.com"      edit family =+ "Andale Mono";

#
# Set some sane defaults for Anti-Aliased desktops
#
match any family == "helvetica"      edit family += "Nimbus Sans L";
match any family == "helv"      edit family += "Nimbus Sans L";
match any family == "verdana"      edit family += "Nimbus Sans L";
match any family == "times"      edit family += "Nimbus Roman No9 L";
match any family == "helvetica"      edit family += "Helmet";
match any family == "helv"      edit family += "Helmet";
match any family == "verdana"      edit family += "Helmet";
match any family == "times"      edit family += "Helmet";

# XFree86 default fonts
match any family == "Verdana"           edit family += "Luxi Sans";
match any family == "Times New Roman"   edit family += "Luxi Serif";

#
# Japanese
#
match any foundry == "watanabe"      edit antialias = false;
match any foundry == "wadalab"      edit antialias = false;

#
# Fixes a problem in KDE with konsole
#
match any family == "fixed"         edit antialias =+ "false";
match any family == "console"      edit antialias =+ "false";

I have also been getting errors as Xserver shuts down complaining that certain fonts don't support something.

Notes 

Netscape 

Now, you have your awesome fonts all blazing away on your screen. Looks awesome, up to the point where you fire up Netscape 4.07 (or so) and all you can recognise in the UI are little boxes where the characters are supposed to be. This is because Netscape expects a specific font and that font only, to display it's stuff. A couple more programs have this problem (VMWare is another I can think of). This perl script makes sure that fonts.alias is created, which should take care of this problem. No more boxes for you!

one logfile 

Next thing I see in the logfile, way at the end, is that it cannot find, or cannot seem to handle the directories /usr/X11R6/lib/X11/fonts/Type1, /usr/X11R6/lib/X11/fonts/Speedo, /usr/X11R6/lib/X11/fonts/TTF and /usr/X11R6/lib/X11/fonts/truetype. Double check if they are there and if you have not made any typos in the directory names. Remember that *NIX is casesensative and that truetype and TrueType are two different values. Also double check if you have done the all the steps in the original post for each of these directories that contain TT fonts. The Speedo and the Type1 directory should work all by themselves, but you do need to load the modules for them. To check if you tell X to load it, check the /etc/X11/XF86Config-4 file for lines saying something like Code:

Load   "speedo"
Load   "type1"

If the module isn't loaded, it won't handle the corresponding font directory.