Thursday, July 24, 2014

Customizing the UNIX User Environment - Part 2 - Customizing X - Part 3

Customizing the UNIX User Environment


Customizing X



Installing fonts


X can use a variety of fonts to display text in windows and on widgets. Before you can use these fonts, however, you need to install them and configure X so that it knows where to find the font files.

XFree86 4.x supports three types of fonts:

-Type 1 fonts - use an Adobe postsscript standard. They store the character glyphs and font metrics in two separate files

-TrueType fonts - use an Apple standard. They've also been widely adopted by Microsoft. They are highly scalable and store all their font info in a single file

-antialiased fonts - new feature of XFree86 4.x. They are rendered more smoothly than other types of fonts.


UNIX stores Type 1 fonts in several font directories that branch from /usr/ports/x11-fonts/.

These include the urwfonts directory and the free fonts directory.


To install donts from a font directory, you navigate to the directory and type

make install clean.


bash-2.05a$ cd urwfonts

bash-2.05a$ make install clean


when you install a set of fonts, UNIX creates font directories in /usr/X11R6/lib/X11/fonts/


To configure X so that it can access these fonts, you need to edit the Files section of the XF86Config file.


You add a FontPath row to the Files section, specifying the location of the font directory. In this case, you specify the path to the URW font directory.


XFree86 4.x supports TrueType fonts using an extension module called freetype. You need to enable this module so that X can access TrueType fonts.


To enable the freetype module, you edit the XF86Config file, adding the following row to the Modules section:

Load "freetype"


XFree86 4.02 and later versions support antialiasing for all scalable font types. However, many desktop toolkits don't support antialiasing. The Qr toolkit for the KDE desktop is one of those that do.


To enable antialising with Qt, you need to edit the /usr/X11R6/lib/X11/XftConfig file using a text editor such as vi. You add lines defining each of the font directories for which you want to enable antialiasing


Because antialiasing smooths out the edges of screen fonts, it makes small fonts more readable and large fonts more attractive. However, it causes eyestrain when applied to medium-size fonts.


To disable antialiasing for medium-size fonts, you add a section to the XftConfig file that matches a range of font sizes - in this case 10 to 14 points - and disables antialiasing for it.


On a large network, it may be better to set up a font server and configure X to look for fonts on the font server.


To configure X to use a font server, you need to edit the XF86Config file and add a FontPath line to the Files section that specifies the port number of the font server. If font server is on port 3 you would see something line


FontPath "unix:/3"


Note: this procedure sets up a system-wide font server. To add a user-specific font server, you need to edit the .xinitrc file in the user's home directory




No comments:

Post a Comment