FONT(4)

NAME
font - font file format

DESCRIPTION
A font file is a file containing a description of a Font that can be read by infont(3R/3L) or loadfont(1) and converted into a Font in the terminal. A font file can be created by using outfont.

A font file begins with a structure that is similar to a Font. It looks like the following:
 struct Fontheader {
        short    n;		/* number of chars in font */
        char     height;	/* height of bitmap */
        char     ascent;	/* top of bitmap to baseline */
        long     unused;	/* in case we think of more stuff */
        Fontchar info[1];	/* n+1 character descriptors */
 }
The fields in this structure have the same meanings as the ones in the Font structure. There are really n+1 Fontchar structures in the info array. The only field that contains valid data in the [n+1]th element is x; the leftmost edge of the corresponding cell in the bitmap. Each Fontchar structure starts on a long integer boundary and is padded with null characters to the next long integer boundary and the start of the next Fontchar structure. Therefore, there are two nulls after each of the n+1 Fontchars in the file.

Following this in the file is the bitmap image of the font. This is an array holding the bit image of all the characters in the font. It corresponds to bits->base in the Font structure. Its size is defined as:
        char base[ height ][ ((info[ n+1 ].x+31)/32)*4 ] The last column of bits used by a font is info[n+1].x-1. The width is rounded up to the nearest long integer boundary for the bitmap image.

SEE ALSO
infont(3L), loadfont(1), structures(3R).