LinuxCommandLibrary

bdftopcf

Convert bitmap fonts to portable compiled format

SYNOPSIS

bdftopcf [ options ] bdf-file

PARAMETERS

-o output_file
    Specifies the name of the output PCF file. If omitted, output goes to standard output.

-p padding
    Sets the bitmap padding (0, 1, 2, or 4 bytes). Default is 4.

-u unit
    Sets the bitmap scanline unit (1, 2, or 4 bytes). Default is 1.

-m metric
    Sets the bitmap scanline endianness (0 for little-endian, 1 for big-endian). Default is architecture-dependent.

-l
    Force all glyphs to be left-padded (default for PCF).

-r
    Force all glyphs to be right-padded.

-s
    Force all glyphs to be padded with the natural scanline unit.

-i
    Do not generate the Ink_Metrics property.

-t
    Do not generate the Terminal_Font property.

-T
    Truncate all character properties that exceed 255 bytes.

-v
    Enable verbose output, showing progress and information.

-V
    Print the program version and exit.

-c
    Only convert characters that explicitly exist in the font's encoding. Unencoded characters are skipped.

-d DPI
    Set default DPI values (e.g., 75, 100) if missing from the BDF font properties.

-B
    Force output PCF to be big-endian. Overrides -m.

-L
    Force output PCF to be little-endian. Overrides -m.

DESCRIPTION

bdftopcf is a utility designed to convert font files from the Glyph Bitmap Distribution Format (BDF) into the Portable Compiled Format (PCF). BDF files are human-readable, ASCII-based descriptions of fonts, including glyph bitmaps, metrics, and properties. While BDF is excellent for font creation and editing, its text-based nature makes it inefficient for direct use by graphical systems.

PCF, on the other hand, is a compact, binary font format optimized for fast loading and rendering by X servers and font utilities within the X Window System. bdftopcf processes the BDF input, performing necessary optimizations and reorganizations of the font data (e.g., bit packing, byte ordering) to produce an efficient PCF file. This conversion is crucial for making custom or non-standard bitmap fonts available to X applications, ensuring they can be quickly loaded and displayed.

CAVEATS

While still functional, bdftopcf is part of an older X Window System font rendering stack. Modern Linux desktops heavily rely on Fontconfig and FreeType for font management, which support scalable font formats (TrueType, OpenType) and provide advanced rendering features. bdftopcf remains relevant for managing legacy bitmap fonts or in specific embedded/minimal X environments where scalable fonts are not desired or feasible. It does not handle font scaling or anti-aliasing; it merely converts bitmap font data.

BDF VS. PCF FONT FORMATS

BDF (Glyph Bitmap Distribution Format) is a simple, human-readable ASCII format for bitmap fonts, commonly used for creating and editing fonts. It describes each glyph pixel by pixel, along with font properties like character set, dimensions, and spacing.

PCF (Portable Compiled Format) is a binary format designed for efficient storage and fast loading by X servers. It compiles the bitmap data and properties from BDF into an optimized structure, making it the preferred format for X Window System font distribution.

INTEGRATION WITH X WINDOW SYSTEM FONTS

For PCF fonts to be used by an X server, they typically need to be placed in a directory configured in the server's font path. After conversion with bdftopcf, tools like mkfontdir are used to create the fonts.dir index file in the font directory. The X server (or a font server like xfs) reads these index files to locate and load the available PCF fonts for display by applications.

HISTORY

bdftopcf has been a fundamental utility within the X Window System font distribution for decades, originating from the XFree86 project and now maintained by the X.Org Foundation. Its development has focused on reliably converting the human-readable BDF format into the efficient, binary PCF format for optimal use by X servers. While its central role in font management has diminished with the rise of scalable font technologies and libraries like Fontconfig and FreeType, it continues to serve as the standard tool for incorporating fixed-size bitmap fonts into the X environment, particularly for older applications or specific display requirements.

SEE ALSO

mkfontdir(1), xset(1), xfs(1), X(7)

Copied to clipboard