Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

troff(1)

vfontinfo(1)

vswap(1)

VFONT(5)  —  FILE FORMATS

NAME

vfont − font formats

SYNOPSIS

#include <vfont.h>

DESCRIPTION

The fonts used by the window system and printer/plotters have the following format.  Each font is in a file, which contains a header, an array of character description structures, and an array of bytes containing the bit maps for the characters.  The header has the following format:

struct header {
shortmagic;/∗ Magic number VFONT_MAGIC ∗/
unsigned shortsize; /∗ Total # bytes of bitmaps ∗/
shortmaxx;/∗ Maximum horizontal glyph size ∗/
shortmaxy;/∗ Maximum vertical glyph size ∗/
shortxtend;/∗ (unused) ∗/
};
#defineVFONT_MAGIC0436

maxx and maxy are intended to be the maximum horizontal and vertical size of any glyph in the font, in raster lines.  (A glyph is just a printed representation of a character, in a particular size and font.) The size is the total size of the bit maps for the characters in bytes.  The xtend field is not currently used. 

After the header is an array of NUM_DISPATCH structures, one for each of the possible characters in the font.  Each element of the array has the form:

struct dispatch {
unsigned shortaddr; /∗ &(glyph) - &(start of bitmaps) ∗/
shortnbytes;/∗ # bytes of glyphs (0 if no glyph) ∗/
charup, down, left, right;   /∗ Widths from baseline point ∗/
shortwidth;/∗ Logical width, used by troff ∗/
};
#defineNUM_DISPATCH256

The nbytes field is nonzero for characters which actually exist.  For such characters, the addr field is an offset into the bit maps to where the character’s bit map begins.  The up , down, left, and right fields are offsets from the base point of the glyph to the edges of the rectangle which the bit map represents.  (The imaginary “base point” is a point which is vertically on the “base line” of the glyph (the bottom line of a glyph which does not have a descender) and horizontally near the left edge of the glyph; often 3 or so pixels past the left edge.)  The bit map contains up+down rows of data for the character, each of which has left+right columns (bits).  Each row is rounded up to a number of bytes.  The width field represents the logical width of the glyph in bits, and shows the horizontal displacement to the base point of the next glyph. 

FILES

/usr/lib/vfont/∗

/usr/lib/fonts/fixedwidthfonts/∗

SEE ALSO

troff(1), vfontinfo(1), vswap(1)

BUGS

A machine-independent font format should be defined.  The shorts in the above structures contain different bit patterns depending whether the font file is for use on a VAX or a Sun.  The vswap program must be used to convert one to the other. 

Sun Release 4.1  —  Last change: 19 October 1987

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