A friend upgraded from Debian woody to Sarge and found the fonts in some applications (Mozilla, Xchat etc) to be ugly. They appeared big and bulky where they ought not. This mini-howto assumes you are running XFree86 v4.x (a current release of X-windows). As most unix-like systems use the same windowing system, this howto is relevant whether you are running a GNU/Linux system such as Debian, Mandrake, Redhat, Slackware or Unix such as BSD, Solaris etc. If you are running a desktop such as KDE, Gnome, Icewm etc, it will be running on top of X-windows. The information in this mini-howto will be relevant to you.
Think of this as the master configuration file for your X-windows set-up. This file tells X-windows where to find fonts, whether you are using a stand-alone X font server, what graphics card, mouse and monitor you have. In most cases, if your X-windows isn't working, changing a setting in XF86Config file will cure it. Don't edit the only working version of your XF86Config file without making a backup of the file first!
Where is the XF86Config file? In order to make X windows as flexible as possible, the system will look in many locations and filenames for the file. You can find a complete list in the man page for XF86Config-4. (Type "man XF86Config-4" at your shell prompt to get the man page. this probably gives much more information than you need at this stage, so don't do it yet- just make a note of it). X windows will look for each of the following filenames in turn. It will use the first matching filename it finds:
/etc/X11/XF86Config-4
/etc/X11/XF86Config
/etc/XF86Config
In most cases. you will find you have a file named /etc/X11/XF86Config-4, in which case, all others are ignored.
Xfree86 will work either with or without a stand-alone font server (ie a font server which starts as a separate demon process on your machine or a remote machine on a network). You can tell you have a stand-alone font server running by typing ps ax | grep xfs. You can tell if your X windows system is set up to use a stand-alone font server by looking for a line similar to FontPath "unix/:7100" in your XF86Config file. If you have xfs running but your X-windows is not set to use it (which is common), You can safely stop/disable the stand-alone font server. It is important to have the font server installed on your system, even if it isn't running as a stand-alone process. (When X-windows starts, it will use the font server program directly, whether or not you use a stand-alone font server).
Some XFS servers may have enhanced features/ enhanced font support. If you have such a server installed and running, you will want to make sure XF86Config is set to use the server.
The X font server can serve fonts locally or over a network. Serving over a network is outside the scope of this howto. We will assume you only want to use a font server on the same machine as your X-windows is running.
Before you can configure X-windows to use your stand-alone font server, you will need to check what port xfs is listening to. By default, xfs will listen to port 7100. The enhanced xfs-xtt (available for woody/ sarge) generally listens to port 7110. You can check by typing ps -ax | grep xfs You will see something like:
5639 ? S 0:00 /usr/bin/X11/xfs -daemon or 258 ? S 0:00 /usr/bin/X11/xfs-xtt -daemon -user nobody -port 7110
The first is running on a default port. The second is running on port 7110.
When your Xserver parses the XF86Config file, the font paths at the top of the list have a higher priority than those further down. Also, the fonts in the font directories towards the top of the list will be used in preference to those in the directories further down the list.
When an entry for an X font server is found, and the font server is running, the entry for the X Font server is, in effect, replaced by a list of font paths used by the X font server.
Therefore, if all the font paths listed in the XF86Config file are also available via the X font server, and the font server is at the top of the list, the font paths listed explicitly in XF86Config are ignored- all fonts will be served by the stand-alone X font server. If the X font server isn't working when X-windows starts, then it will fall back on the list of explicit paths in XF86Config.
It is usual to have your X font server at the top of the list, so that the fonts from the stand-alone server have a higher priority. I am using xfs-xtt on port 7110. Therefore my list of font paths looks like this:
Section "Files"
FontPath "unix/:7110" # local stand-alone font server
# if the local font server has problems, we can fall back on these
FontPath "/usr/lib/X11/fonts/misc"
FontPath "/usr/lib/X11/fonts/cyrillic"
FontPath "/usr/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/Type1"
FontPath "/usr/lib/X11/fonts/Speedo"
FontPath "/usr/lib/X11/fonts/75dpi"
FontPath "/usr/lib/X11/fonts/100dpi"
EndSection
In this mini-howto, I will not go into depth about configuring a standalone X font server. I will concentrate on DPI, as this seems to make a big difference to the appearance of X applications.
Your X font server config file might be /usr/X11R6/lib/X11/fs/config or /usr/X11R6/lib/X11/fs-xtt/config, depending on which xfs you are using. My font paths in the X font server file are as follows:
catalogue = /var/lib/defoma/x-ttcidfont-conf.d/dirs/CID,
/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,
/usr/lib/X11/fonts/misc/:unscaled,
/usr/lib/X11/fonts/cyrillic/:unscaled,
/usr/lib/X11/fonts/75dpi/:unscaled,
/usr/lib/X11/fonts/100dpi/:unscaled,
/usr/lib/X11/fonts/Type1/,
/usr/lib/X11/fonts/Speedo/
The same priority rules apply in the standalone X font server configuration file as those in XF86Config. The font paths which appear first get priority. I have set the 75dpi fonts to a higher priority, making them the default unscaled font. (I find many applications look much neater with the default unscaled font set to 75dpi).
The config file also specifies default resolutions. This setting is used in instances where a scalable font is being substituted for fixed resolution fonts. This setting seems to make no difference to the appearance of applications on my system.
You might find some applications looking ugly with fonts out of proportion. Default settings for debian Sarge, the 100dpi fonts appear in the fontpaths first. If the 100dpi fonts are installed, they will have priority over the 75dpi fonts. I find the 75dpi fonts look much better when set as default, with 100dpi set at a lower priority. 100dpi fonts set to a priority higher than that of 75dpi (100dpi as default) make Mozilla, xchat and many other applications look ugly- the fonts look out of proportion with the graphical objects. To make the applications look better, make sure the 75dpi font path appears before the 100dpi font path in
/etc/X11/XF86Config
and/or
/usr/X11R6/lib/X11/fs/config
and/or
/usr/X11R6/lib/X11/fs-xtt/config
Then, as necessary, reboot or restart xfs and X windows.
I suggest you do have the 100dpi fonts installed. Some applications make specific use of the 100dpi unscalable font.
The 75/100dpi font scheme on X-windows is a classic kludge.
Applications use a mixture of scalable and unscalable. By making the dpi of the unscalable fonts higher, the unscalable fonts get bigger. The graphics and scalable fonts remain the same, making applications look ugly.
A neater solution is to stick to one default resolution for unscalable fonts. As most applications have been designed around the standard 75dpi fonts, we should set the 75dpi fonts as default.
You can choose the Dots-Per-Inch resolution (eg 75dpi/ 100dpi) your X-windows session runs at and you can choose the resolution of unscalable font your X-windows session will use. These are separate settings. The unscalable font resolution your X-windows system uses is chosen by the order of the font paths (in XF86Config or xfs-config) and which unscalable font resolutions (75/100dpi) you have installed, as described above.
You can find out how many DPI your X-windows session is using by typing ps ax | grep X at a console, after X has started. You will see something like
527 ? S 0:13 /etc/X11/X -dpi 75 -nolisten tcp vt7
In this case, the Xserver is running at 75dpi. To change the dpi, you will need to edit the script or configuration file which starts X
To help you make a decision how you would like your applications to look, I have provided some screen shots showing how Mozilla looks with:
a=Xserver running at 100 dpi
b=Xserver running at 75dpi
75=75dpi unscalable fonts
100=100dpi unscalable fonts
a75![]() | a100![]() |
b75![]() | b100![]() |
Sample page at http://www.promptweb.co.uk/multisearch/
You can configure the Xserver dpi from startx, kdm, xdm, gdm or whatever login manager you use. I use kde3 so use kdm. Therefore I edit /etc/kde3/kdm/Xservers
This howto is provided under the GNU Free Documentation License
I can be contacted by email: nick [at] nickhill [dot] co [dot] uk.