


      FONT(4)                    (Bull-SPS9)                    FONT(4)



      NAME
           font - format of Bull-SPS9 bit-matrix fonts

      SYNTAX
           #include <sys/font.h>

      DESCRIPTION
           A Bull-SPS9 bit-matrix font file contains a header and a
           sequence of pixel patterns or ``glyphs'' corresponding to
           the images of individual characters.  The file also has a
           table of indices into the bit-matrix patterns for each
           character in the font.

           The structure of a font file is given in the include file,
           where the last two fields are actually variable length
           arrays of 32-bit words:

                struct Font {
                        int format;
                        int min;
                        int max;
                        int maxWidth;
                        int length;
                        int ascent;
                        int descent;
                        int xOffset;
                        int formWidth;
                        int glyphs[1];  /* variable length */
                        int xTable[1];  /* variable length */
                };

           The format field contains a magic number which identifies
           the file as containing bit-matrix font information.  The
           value for this field is given by the following define in the
           include file:

                #define FontMagic 0xABCDDCBA

           The min field contains the smallest legal ASCII value for
           this font.  Characters less than this value will be
           displayed using the glyph for the illegal character (indexed
           by max+1).  The max field contains the largest legal ASCII
           value for this font.  There should always be a glyph for
           each character from min to max+1, where the extra glyph is
           used for displaying characters that fall outside the range.

           The maxWidth field contains the width in bits of the widest
           character in the font.  The height in bits above (and
           including) the baseline is kept in ascent, while the height
           in bits below the baseline is kept in descent.  All
           characters in a font have the same bit-matrix height (ascent
           + descent), but may vary in width.  The bit-matrix for each



      Page 1                                         (73 A2 02MTA REV1)






      FONT(4)                    (Bull-SPS9)                    FONT(4)



           character should include appropriate white space around each
           character so that bit-matrices may be placed side-by-side in
           both the horizontal and vertical directions.  The xOffset
           field is normally zero, but can be negative for a font with
           ligatures.  The offset value is added to the normal width of
           each character before advancing to the next character in a
           string being printed horizontally.

           The glyphs array of 32-bit words contains the actual bits
           for all the characters in a form suitable for the
           CopyBits(3X) operation.  The array is of variable length,
           composed of a number of rasters equal to the font's height,
           with each raster measuring formWidth bits long (rounded up
           to the next integral 32-bit word).  Each raster corresponds
           to a row slice through the bit-matrices of all the
           characters packed together horizontally.  Thus, formWidth is
           the sum of all the characters' widths in bits.

           The xTable array of words is of variable length and is
           indexed by a character's ASCII value, justified to index
           from min through max+2.  The contents of each entry is the
           left X (measured in bits) within the glyphs for the selected
           character.  The entries are ordered in increasing value, and
           thus the difference between two adjacent entries represents
           the width of the character indexed by the smaller indice.
           The max+1 entry is the left X for the ``illegal'' character
           glyph, and the max+2 entry contains the value one greater
           than the right X of the ``illegal'' character glyph.

           The length field contains the number of 32-bit words in the
           font following this field.  This value can be computed as:

                7 + (max - min) +
                (((formWidth + 31) / 32) * (ascent + descent))

      FILES
           /usr/include/sys/font.h

      SEE ALSO
           setfont(1), windows(3X), disp(7)















      Page 2                                         (73 A2 02MTA REV1)



