


      FFFFOOOONNNNTTTT((((4444))))                      ((((RRRRiiiiddddggggeeee))))                      FFFFOOOONNNNTTTT((((4444))))



      NNNNAAAAMMMMEEEE
           font - format of Ridge bit-matrix fonts

      SSSSYYYYNNNNTTTTAAAAXXXX
           ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ffffoooonnnntttt....hhhh>>>>

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           A Ridge 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 _f_o_r_m_a_t 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 _m_i_n 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 _m_a_x+_1).  The _m_a_x field contains the largest legal ASCII
           value for this font.  There should always be a glyph for
           each character from _m_i_n to _m_a_x+_1, where the extra glyph is
           used for displaying characters that fall outside the range.

           The _m_a_x_W_i_d_t_h 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 _a_s_c_e_n_t, while the height
           in bits below the baseline is kept in _d_e_s_c_e_n_t.  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                                                   (9010-E)






      FFFFOOOONNNNTTTT((((4444))))                      ((((RRRRiiiiddddggggeeee))))                      FFFFOOOONNNNTTTT((((4444))))



           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 _x_O_f_f_s_e_t
           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 _g_l_y_p_h_s array of 32-bit words contains the actual bits
           for all the characters in a form suitable for the
           _C_o_p_y_B_i_t_s(3) operation.  The array is of variable length,
           composed of a number of rasters equal to the font's height,
           with each raster measuring _f_o_r_m_W_i_d_t_h 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, _f_o_r_m_W_i_d_t_h is
           the sum of all the characters' widths in bits.

           The _x_T_a_b_l_e array of words is of variable length and is
           indexed by a character's ASCII value, justified to index
           from _m_i_n through _m_a_x+_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 _m_a_x+_1 entry is the left X for the ``illegal'' character
           glyph, and the _m_a_x+_2 entry contains the value one greater
           than the right X of the ``illegal'' character glyph.

           The _l_e_n_g_t_h 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))

      FFFFIIIILLLLEEEESSSS
           /usr/include/sys/font.h

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           setfont(1), windows(3X), disp(7)















      Page 2                                                   (9010-E)



