LinuxCommandLibrary

fontimage

Convert PSF fonts into images

SYNOPSIS

fontimage [OPTION...] [BDF-FILE]

PARAMETERS

-a, --antialias=METHOD
    Antialiasing: none, grayscale, rgba (default: none)

-C CHARSET, --charset=CHARSET
    Character set: UCS, ISO8859-1, etc., or name like 'Print'

-E COLOR, --errorcolor=COLOR
    Color for missing glyphs (default: magenta)

-f FILE, --font=FILE
    Input BDF font file (default: stdin)

-F FORMAT, --format=FORMAT
    Output: png, xpm (default: png)

-g GEOM, --geometry=WxH[+X+Y]
    Output image dimensions and position

-h, --help
    Display usage help

-o FILE, --output=FILE
    Output file (default: stdout)

-p PADDING, --padding=PADDING
    Pixels between glyphs (default: 2)

--stretch=PERCENT
    Horizontal stretch factor (default: 100)

-V, --version
    Print version info

-x N, --maxcols=N
    Maximum columns (default: 16)

-y N, --maxrows=N
    Maximum rows (default: 16)

DESCRIPTION

fontimage is a utility for rendering bitmap fonts in BDF (Bitmap Distribution Format) into image files, primarily PNG or XPM. It arranges glyphs in a grid layout within a single output image or can produce separate images per character. This tool is particularly useful for generating visual font samples, documentation screenshots, or fallback images for web and print media where scalable fonts are unavailable.

Input is typically a BDF file describing a fixed-width bitmap font. Users specify foreground and background colors, padding between glyphs, grid dimensions (rows/columns), antialiasing options, and output geometry. The renderer supports basic stretching and character set selection like ISO8859-1 or Unicode subsets. Error pixels (missing glyphs) are highlighted in a distinct color.

Common workflow: pipe a BDF font to fontimage or specify via -f, customize appearance, and redirect output to a file. It's lightweight, dependency-free for core use, and integrates with X11 font tools for previewing console or legacy display fonts.

CAVEATS

Input limited to BDF format; no TrueType/OpenType support. Grid layout may distort if glyph counts don't fit dimensions. Large fonts can produce huge images.

COLOR SPECIFICATION

Colors accept names (e.g. 'red') or #RRGGBB hex. Defaults: black foreground, white background.

PER-GLYPH OUTPUT

Use -o pattern like %c.png (%c = char code) for individual glyph images.

HISTORY

Developed as part of X11 font utilities (xfonts-utils package) around early 2000s for bitmap font handling in Linux/Unix systems. Maintained for legacy console and embedded font rendering.

SEE ALSO

Copied to clipboard