Introduction
BDF is a plain text format for bitmap fonts, defined by Adobe and adopted by the X Window System as its standard way to distribute fonts. Each glyph is stored as a grid of pixels at one fixed size, so BDF fonts are sharp at that size and nothing else. They are still used for terminal and programming fonts on Linux, and for the small screens of embedded devices and microcontroller projects.
The X server traditionally converted BDF to its binary PCF format for faster loading.
Structure
A BDF file is plain text made of keyword lines. It starts with
STARTFONT 2.1, then the font name, point size and resolution, the bounding
box of all glyphs, and a block of properties between STARTPROPERTIES and
ENDPROPERTIES. CHARS gives the number of glyphs. Each glyph
runs from STARTCHAR to ENDCHAR and gives its code point
(ENCODING), its advance width (DWIDTH), its bounding box
(BBX) and, after BITMAP, one line of hexadecimal per pixel row.
The file ends with ENDFONT.
STARTCHAR A
ENCODING 65
SWIDTH 500 0
DWIDTH 8 0
BBX 8 8 0 0
BITMAP
18
24
42
42
7E
42
42
00
ENDCHAR
Links
Software
- FontForge (Windows, macOS, Linux)
- Any text editor, since the format is plain text
Developers
- FreeType, C library that renders BDF fonts
Reference
- Glyph Bitmap Distribution Format (BDF) Specification, version 2.2, Adobe, 1993