What is a BDF font and how do i use it?
by drjWhat is BDF
A bitmap font format.
BDF stands for Bitmap Distribution Format, and the
Adobe specification that defines it uses the full title
Adobe Glyph Bitmap Distribution Format.
It is an ASCII text-based format for bitmap fonts (pixel fonts).
The use of BDF is largely historical. X11 introduced BDF fonts in 1988, with the X11R3 release; BDF fonts were used extensively after that, they have now largely been replaced with scalable vector font formats (TrueType and OpenType).
How do i make a BDF font?
Use xmbdfed on Linux.
It’s nearly 30 years old, but i got it compiling on Linux.
xmbdfed uses BDF as its native format, and can
import and export a few other formats.
I did also compile it on macOS, using dependencies from homebrew.
It runs under XQuartz and the experience is even more
confusingly clunky than Linux.
I would avoid gbdfed, the successor to xmbdfed that uses GTK,
as it is more crashy.
The format of BDF
is simple enough that you can edit a BDF in a text editor and
probably guess the format.
You can use nano or vi or somesuch (and probably will need to
from time to time if you use xmbdfed).
The actual bitmap images are stored as rows of hexadecimal numbers,
which is a bit tedious to edit and input by hand.
But that is how i made my NEC7228 BDF font.
Conversion
You can also make a BDF font by converting from another format.
mac2bdf converts from the ancient Macintosh
NFNT (new font) bitmap font format to BDF.
monobit converts from pretty much
anything to anything, and...
monobit supports its own text-based font format that is slightly more
human-editable than BDF.
Making your own text-based font format and converting to BDF is
another way to do it.
I have a format called BEF: Bitmap Extended Format.
How do i use a BDF font?
Either, a) install the BDF font and configure you application; or,
b) convert to a more modern format, like TTF, and install and use that.
How do i install a BDF font?
The classic way is to:
- choose a directory, like maybe
~/.local/fonts, or wherever the font is right now (can be handy when editing a font) - put the font there (or leave it there)
- run
mkfontdiron or in that directory - add that path to your Xserver with
xset +fp _path_
The fp in the xset command stands for font path.
If you add or update fonts that are already in the font path then,
make sure that no program is using the font, and run xset fp rehash
PCF?
Not necessary in 2026. Unless you really are running on a 40MHz Sun server with 100s of users.
The bdftopcf tool does make a reasonable linter for BDF fonts tho,
so it can be a good idea to run it anyway.
It will tell you about any errors it spots, and there’s a good chance
your downstream users will be running it.
How do i use a font (now that it is installed)?
Set the font resource for a widget in which you want the font to appear to a font selector matching the font.
For example:
Using xedit and setting its resource using the Xt -xrm flag:
xedit -xrm 'Xedit*editWindow*font: *tencon*' _filename_
xterm, and some other programs, has a -fn flag to set the main
font directory:
xterm -fn '*tencon*'
xman has a custom resource (two in fact, one for normal text and one
for bold; and really you should probably set both):
xman -xrm 'Xman*manualFontNormal: *tencon*'
The resources referred to above are used by the Resource Manager
of apps using the Xt toolkit (basically, ancient X11 apps).
They can be set in your ~/.Xresources file; see xrdb(1) and friends.
Resource names?
See man page, for example man xedit.
Font names?
See xlsfonts (CLI) and xfontsel (GUI).
And the FONT NAMES section of X(1).
Font cache?
I don’t know her.