bdftruncate
Reduce size of BDF fonts
SYNOPSIS
bdftruncate [options] [input.bdf] > output.bdf
PARAMETERS
-a
Assume default start char. Removes the need for STARTCHAR and ENDCHAR keywords. Used for non-standard BDF files.
-b bits
Sets the number of bits to truncate from the bottom of each character.
-l bits
Sets the number of bits to truncate from the left of each character.
-r bits
Sets the number of bits to truncate from the right of each character.
-t bits
Sets the number of bits to truncate from the top of each character.
-c char
Specifies a single character to keep.
-u min-char
Specifies the lowest character to keep (as its decimal Unicode codepoint).
-U max-char
Specifies the highest character to keep (as its decimal Unicode codepoint).
-x min-ascii-char
Specifies the lowest character to keep (as its ASCII character).
-X max-ascii-char
Specifies the highest character to keep (as its ASCII character).
-n
Discard characters without bitmaps.
DESCRIPTION
The bdftruncate command modifies a BDF (Glyph Bitmap Distribution Format) font file by removing or truncating character definitions. It's primarily used to reduce the size of the font file by removing unnecessary glyphs or parts of them.
The command iterates through the characters present in the input BDF file and applies rules based on provided parameters. Characters that don't meet the specified criteria are either entirely removed, or their bitmap data is modified (truncated). This allows the user to create a smaller, more focused font file containing only the necessary characters.
bdftruncate is especially useful when dealing with large fonts where a subset of characters is needed to reduce memory footprint. It's an older tool, but still useful when manipulating BDF fonts directly.
CAVEATS
The command overwrites characters. Always back up your font file first. Understanding BDF font format is essential to use this tool effectively.
OUTPUT REDIRECTION
The output of bdftruncate is typically redirected to a new file using the '>' operator. This allows you to keep the original BDF file intact while creating a modified version. For example: bdftruncate -u 32 -U 126 input.bdf > output.bdf
HISTORY
bdftruncate has been around for a long time, predating widespread adoption of more modern font formats. It was created to address memory constraints in older systems where large BDF fonts were impractical. While BDF fonts are not as commonly used today as they once were, bdftruncate remains useful in embedded systems and for specialized font manipulation tasks.
SEE ALSO
bdf2ps(1), bdftopcf(1), pcf(5)