Graphics Fonts Q and A's

Graphics Fonts Q and A's


1. Are there any font customization clients?
2. Can I get a further explanation of font files?
3. How do I install fonts or update the fonts.dir?
4. How do I determine which font a font alias is pointing to?

1. Are there any font customization clients?

The following list provides some very useful clients that you can use in conjuction with the font customization.

xlsfonts
lists all font IDs of the fonts that you have installed on your workstation.
xfd
displays the printable character of a font.
mkfontdir
is used when you install new fonts on your X server. It creates a new version of fonts.dir.
xfontsel
is a client you can use when you have to extract a font from the XLFD description. xfontsel will give you the font name.
showsnf
prints the contents of a .snf font file.
bdftosnf
3.2.5 utility to convert .bdf files to .snf font files.
bdftopcf
utility to convert .bdf files to .pcf font files.
xset
sets option for the X server.

The .Xdefaults file may have some resources for customizing the default fonts for specific X clients.


2. Can I get a further explanation of font files?

Each font that AIXwindows can use is stored in a file. The fonts files are located in one of several directories, or they may be obtained from a font server.

When an X client requests a server to load a font, the X server searches in the defined font directories. The default font paths for the server is the /usr/lpp/X11/lib/X11/fonts directory.

NOTE: /usr/lib/X11/fonts is also a path, but it is linked to the /usr/lpp/X11/lib/X11 font directory.

The font files may have different extensions as listed below.

snf
server normal font. This is the normal font used by the X server. These fonts will normally not work when ported to another server.
snf.Z
As the font files can be very large, the X server can load compressed font files. Sources from fonts are usually in BDF format (Bitmap Distribution Format), if you want to use fonts which are not already on your local X-Window server you can either get those BDF files via FTP and compile them with the bdftopcf utility or use a font server.
pcf
Portable compiled font. The SNF fonts used in earlier levels of AIX have been replaced in V3.2.5 by PCF fonts. The background is the change from X11R4 to X11R5: in X11R4 the SNF (Server Normal Fonts) fonts were used while X11R5 has switched to PCF (Portable Compiled Font). The advantage of PCF fonts compared to SNF fonts is the capability each X Window server and gives the capability of using a font server.

Note that .bdf files may be converted with the bdftosnf utility into .snf font files. Also, an additional utility, bdftopcf, is provided for converting .bdf files to .snf font files.

Two other files in a font directory:

fonts.dir
Every font has a font ID (the XLFD description) which identifies a font. In the fonts.dir file each XLFD description (font ID) maps to one font file. When you start an X application that uses a font, you have to specify the font ID. The client sends the font ID to the server that loads the font file which maps the font ID. If the server doesn't find the font ID in its fonts.dir files, it generates an error message on the screen and chooses a default font instead. You can generate a fonts.dir file for a specific font directory with the mkfontdir command.
fonts.alias
This is a file you have to edit yourself. It maps each font ID to an alias. With this alias name you can specify a font for an X client on this server. An alias is the logical name for a font. You can set several fonts for one physical font. This is useful when a client asks for a font that is not implemented on your server, and you select the font which is the closest to the one requested and give it the alias name of the requested font.

3. How do I install fonts or update the fonts.dir?

Perform the following steps:

  1. Copy the fonts file in the appropriate directory (.snf, .bdf compressed file) by entering:
    	mkfontdir <directory>
    

    NOTE: mkfontdir decompresses and converts the files into .snf format.

  2. Edit the fonts.alias file (optional).

  3. If you have created a new directory, enter:
    	xset +fp <directory>
    	xset fp rehash
    

4. How do I determine which font that a font alias is pointing to?

Enter the xfd command. For example:

	xfd -fn rom14



[ Doc Ref: 97249017821786     Publish Date: Oct. 25, 2000     4FAX Ref: none ]