HPlogo Using the X Window System > Chapter 6 Using Fonts

Bitmapped Font Administration

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

Bitmapped fonts are included with the X Window System. They are located in the fonts subdirectories of /usr/lib/X11. You may use them as described in the following chapters without special installation or licensing steps.

Adding and Deleting Bitmapped Fonts

To add a bitmapped font:

  1. If the font is not already in .pcf format, put it into the .pcf format using bdftopcf.

  2. Compress the .pcf file using compress.

  3. Copy the file into the desired directory.

  4. Run mkfontdir to update the fonts.dir file for that directory.

  5. If the directory is providing fonts to the X server, run xset -fp rehash to notify the X server of the changes. If the directory is providing fonts to a font server, run kill -USR1 pid1368 , to notify the font server of the changes.

To delete a bitmapped font:

  1. Delete the font file.

  2. Run mkfontdir to update the fonts.dir file for that directory.

  3. If the directory is providing fonts to the X server, run xset -fp rehash to notify the X server of the changes. If the directory is providing fonts to a font server, run kill -USR1 pid, to notify the font server of the changes.

Creating a fonts.dir file with `mkfontdir'

The mkfontdir utility creates the fonts.dir file within a font directory.

The syntax for mkfontdir is:

mkfontdir directory,directory,...

where:

directory

is a font directory. If no directory is given, the current directory is assumed.

Compiling BDF Fonts to PCF Fonts with `bdftopcf'

X bitmapped fonts can be represented in several formats. A font's format is signified by the extension that appears after the font's file name:

.pcf

Portable binary font description file.

.pcf.Z

Compressed .pcf file.

.bdf

Plain text font description file.

.bdf.Z

Compressed .bdf file.

.bcf

Compressed .bdf file.

.snf

(Prior to X11R5) Non-portable binary font description file.

.snf.Z

(Prior to X11R5) Compressed .snf file.

.scf

(Prior to X11R5) Compressed .snf file.

Although all of these formats can be read by the X and font servers, the preferred representation for font storage are the .pcf and .pcf.Z formats. All bitmapped fonts shipped with HP-UX are shipped in the .pcf or .pcf.Z format.

The font compiler bdftopcf converts a font in bitmap distribution format (.bdf) into the .pcf format.

The syntax for bdftosnf is:

   bdftopcf [options] filename

where options are:

-pnumber

Specifies that font characters should be padded on the right with zeros to the boundary of word number where number is 1, 2, 4, or 8.

-unumber

Force the scanline unit padding to 1, 2, 4, or 8.

-l

Specifies the output of bdftopcf to be least significant byte first.

-L

Specifies the output of bdftopcf to be least significant bit first.

-m

Specifies the output of bdftopcf to be most significant byte first.

-M

Specifies the output of bdftopcf to be most significant bit first.

-t

Expand glyphs in "terminal emulator" fonts to fill the bounding box.

-i

Don't compute ink metrics for "terminal emulator" fonts.

-o pcf_file

Specifies the name of the output .pcf file. If not specified, bdftopcf sends its output to stdout.

filename

Specifies the name of the .bdf font to be converted into portable compiled format.

The following example takes a bitmap distribution bitmap font file named tmrm12b.bdf and converts it to a compressed portable compiled format file:

   bdftopcf tmrm12b.bdf | compress >timrm12b.pcf.Z
© 1995 Hewlett-Packard Development Company, L.P.