Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

loadfont(1)



          loadfont(5)          INTERACTIVE UNIX System          loadfont(5)



          NAME
               loadfont - format of a loadfont input file

          DESCRIPTION
               This section describes the format of files that can be used
               to change the font used by the console when using the load-
               font utility with the -f option.

               The format is compatible with the Binary Distribution Format
               version 2.1 as developed by Adobe Systems, Inc., however,
               certain restrictions apply.  Video cards, when used with the
               INTERACTIVE UNIX Operating System in textmode, only accept
               constant width, constant height fonts of certain sizes.  The
               loadfont utility also requires that there is a description
               of all 256 characters of the codeset used specified in the
               fontfile.  Certain attributes are not used by loadfont but
               are maintained for compatibility purposes.

               As a consequence, fontfiles used with loadfont can also be
               used for other purposes, such as with the INTERACTIVE X11
               Windowing System, but not always the other way around.

             File Format
               A loadfont input file is a plain ASCII file containing only
               printable characters (octal 40 through 176) and a carriage
               return at the end of each line.

               The information about a particular font should be contained
               in a single file.  The file begins with information on the
               font in general, followed by the information and bitmaps for
               the individual characters.  The file should contain bitmaps
               for all 256 characters, and each character should be of the
               same size.

               A font bitmap description file has the following general
               form, where each item is contained on a separate line of
               text in the file.  Items on a line are separated by spaces:

                    The word STARTFONT followed by the version number 2.1.

                    One or more lines beginning with the word COMMENT These
                    lines can be used to add comments to the file and will
                    be ignored by the loadfont program.

                    The word FONT followed by the full name of the font.
                    The name continues all the way to the end of the line,
                    and may contain spaces.

                    The word SIZE followed by the point size of the charac-
                    ters, the x resolution, and the y resolution of the
                    font.  The sizes are not verified by loadfont but the
                    line containing this keyword needs to be there for com-
                    patibility purposes.


          Rev. 1.1                                                   Page 1





          loadfont(5)          INTERACTIVE UNIX System          loadfont(5)



                    The word FONTBOUNDINGBOX followed by the width in x,
                    height in y, and the x and y displacement of the lower
                    left-hand corner from the origin.  Again, the sizes are
                    not verified by loadfont but this line containing the
                    keyword needs to be there for compatibility purposes.

                    Optionally, the word STARTPROPERTIES followed by the
                    number of properties that follow. If present, the
                    number needs to match the number of lines following
                    this one before the occurrence of a line beginning with
                    ENDPROPERTIES These lines consist of a word for the
                    property name followed by either an integer or string
                    surrounded by double quotes.  Properties named
                    FONT_ASCENT FONT_DESCENT and DEFAULT_CHAR are typically
                    present in BDF files to define the logical font-ascent
                    and font-descent and the default-char for the font.

                    As mentioned above, this section, if it exists, is ter-
                    minated by ENDPROPERTIES.

                    The word CHARS followed by the number of characters
                    that follow.  This number should always be 256.

               This terminates the part of the loadfont input file describ-
               ing features of the font in general.  The rest of the file
               contains descriptions of the individual characters.  They
               consist of the following parts:

                    The word STARTCHAR followed by up to 14 characters (no
                    blanks) describing the character.  This can either be
                    something like C0041, which indicates the hex value of
                    the character or uppercaseA, which describes the char-
                    acter.

                    The word ENCODING followed by a positive integer
                    representing value by which this character is
                    represented internally in the codeset for which this
                    font is used.  The integer needs to be specified in
                    decimal.

                    The word SWIDTH followed by the scalable width in x and
                    y of character.  Scalable widths are in units of
                    1/1000th of the size of the character.  The y value
                    should always be 0; the x value is typically 666 for
                    the type of characters used with loadfont The values
                    are not checked by the loadfont utility, but this line
                    needs to be there for compatibility purposes.

                    The word DWIDTH followed by two numbers, which in a BDF
                    file would mean the width in x and y of the character
                    in device units.  The y value is always zero. The x
                    value is typically 8.  loadfont checks only for the
                    presence of the DWIDTH keyword.


          Rev. 1.1                                                   Page 2





          loadfont(5)          INTERACTIVE UNIX System          loadfont(5)



                    The word BBX followed by the width in x, height in y
                    and x and y displacement of the lower left-hand corner
                    from the origin of the character.

                    Most fonts used by video cards will not use the bottom
                    4 rows of pixels, which basically means a vertical (y)
                    displacement of -4.  The only width allowed by loadfont
                    is 8; heights supported are 8, 14, and 16.  All BBX
                    lines of the subsequent characters should list the same
                    height and width as the first one (because only fixed
                    size fonts are supported).

                    The optional word ATTRIBUTES followed by the attributes
                    as 4 hex-encoded characters. The loadfont utility will
                    accept this line, if present, but there is no meaning
                    attached to it.

                    The word BITMAP, which indicates the beginning of the
                    bitmap representation of the character.  This line
                    should be followed by height lines (height as specified
                    in the BBX line)
                    representing a hex-encoded bitmap of the character, one
                    byte per line.

                    The word ENDCHAR indicating the end of the bitmap for
                    this character.

                    After all the bitmaps, the end of the file is indicated
                    by the ENDFONT keyword.

             Example
               The following example lists the beginning of the loadfont
               input file for an 8 by 16 font, supporting the IBM 437
               codeset, as well as the bitmap representation of the charac-
               ter uppercase A.

                 STARTFONT 2.1
                 FONT 8x16
                 SIZE 16 75 75
                 FONTBOUNDINGBOX 8 16 0 -4
                 STARTPROPERTIES 3
                 FONT_DESCENT 4
                 FONT_ASCENT 12
                 DEFAULT_CHAR 0
                 ENDPROPERTIES
                 CHARS 256
                 STARTCHAR C0000
                 ENCODING 0
                 ...

               Bitmap for uppercase A character:

                 STARTCHAR C0041


          Rev. 1.1                                                   Page 3





          loadfont(5)          INTERACTIVE UNIX System          loadfont(5)



                 ENCODING 65
                 SWIDTH 666 0
                 DWIDTH 8 0
                 BBX 8 16 0 -4
                 BITMAP
                 00
                 00
                 10
                 38
                 6c
                 c6
                 c6
                 fe
                 c6
                 c6
                 c6
                 c6
                 00
                 00
                 00
                 00
                 ENDCHAR

          FILES
               /usr/lib/loadfont/vga437.bdf

          SEE ALSO
               loadfont(1).



























          Rev. 1.1                                                   Page 4



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026