1.3. AAF Font File Format.

The AAF Font File Format is used to store fonts in both Fallout and Fallout 2. Only the AAF files used in the English versions are discussed here, there may or may not be variations for other languages.

The AAF file stores a separate glyph for each of the 256 position in the ASCII table. The fonts in an AAF file are typically non-fixed size, i.e. each glyph has it's own width and height. A glyph is defined by a rectangular bitmap representing the pixels of the glyph, corresponding to the way that it appears on the screen. Each pixel can have a possible value in the range of 0 to 9.

Here is an example of the bitmap of a glyph. This glyph is from the file font1.aaf and represents the character 'b' (ASCII 98).

   77
   77
   777763
   77  76
   77  77
   77  76
   777763

Pixels with value 0 are not shown as they are transparent. The higher numbers 7 and 6 represent the brighter parts of the glyph, while the 3 would be much duller in colour. This would be expected for the rounder corners of the b.

Offset Size Data Type Description
0x0000 4 string = "AAFF" Signature used to identify file type.
0x0004 2 unsigned Maximum glyph Height.

This is the maximum height of the glyph, including ascenders and descenders.

0x0006 2 unsigned Horizontal gap.

Gap size (in pixels) between adjacent glyphs.

0x0008 2 unsigned Width of space.

The width of the space character.

0x000A 2 unsigned Vertical gap.

The number of pixels between two lines of glyphs.

0x000C 2 unsigned GLYPH-0-WIDTH : Width of glyph 0.

The width (in pixels) of the glyph corresponding to ascii 0.

0x000E 2 unsigned GLYPH-0-HEIGHT : Height of glyph 0.

The height (in pixels) of the glyph corresponding to ascii 0.

0x0010 4 unsigned Offset of glyph 0.

The offset in this AAF file where the data for glyph 0 is stored.

0x0014 2 unsigned GLYPH-1-WIDTH : Width of glyph 1.
0x0016 2 unsigned GLYPH-1-HEIGHT : Height of glyph 1.
0x0018 4 unsigned Offset of glyph 1.
0x001C (2 + 2 + 2) * (256 - 2) unsigned Descriptions of glyphs 2 through 255, as described above.
0x0610 GLYPH-0-WIDTH * GLYPH-0-HEIGHT unsigned = [0..9] Pixel data for glyph 0.

Contains the pixel data for the glyph. Each pixel in the glyph is represented by one byte, with possible values in the range 0 to 9. A value of 0 means the pixel is transparent, while values 1 to 9 represent different brightness values of the pixel (1 is dark and 9 is bright). Pixel data is starts at the top left corner of the glyph and increases left to right, then top to bottom.

0x0610 + (GLYPH-0-WIDTH * GLYPH-0-HEIGHT) GLYPH-1-WIDTH * GLYPH-1-HEIGHT unsigned = [0..9] Pixel data for glyph 1.
0x0610 + (GLYPH-0-WIDTH * GLYPH-0-HEIGHT) + (GLYPH-1-WIDTH * GLYPH-1-HEIGHT) ... unsigned = [0..9] Pixel data for glyphs 2 to 255, as described above.


Note: All integers are in big endian format.

Created by Noid.