LinuxCommandLibrary

chkfont

Check font file properties

TLDR

Check a font file for formatting errors

$ chkfont [path/to/font.flf]
copy

Check all .flf font files in a directory
$ chkfont [path/to/fonts]/*.flf
copy

SYNOPSIS

chkfont [-v] fontfile ...

PARAMETERS

-v
    Enable verbose output, providing detailed parsing information

DESCRIPTION

chkfont is a utility from the X11 font utilities package (xfonts-utils) designed to verify the integrity and correctness of bitmap font files in PCF (Portable Compiled Font) format. These fonts are used by the X Window System for rendering text in legacy graphical applications.

It parses the font file's structure, including the header, metrics table, bitmaps, ink metrics, and properties, checking for common issues such as malformed headers, invalid bitmap data, inconsistent glyph metrics, missing characters, or encoding errors. If errors are detected, it reports them to standard error with details on the problematic sections.

Primarily used by system administrators to validate fonts before serving them via the X Font Server (xfs) or installing them system-wide. This prevents display corruptions, application crashes, or suboptimal rendering in X clients. In modern systems with fontconfig and scalable fonts dominating, chkfont remains relevant for legacy bitmap fonts in environments like embedded systems or specific desktop setups.

Simple to use: point it at font files, and it exits with 0 on success or non-zero on errors. Verbose mode aids debugging.

EXIT STATUS

0 if all fonts valid; 1 if errors found; 2 on usage error.

EXAMPLE

chkfont -v /usr/share/fonts/X11/misc/6x13.pcf
Checks a specific font file verbosely.

HISTORY

Developed as part of early X11 releases (X11R4+), maintained in Xorg's xfonts-utils. Usage peaked in pre-fontconfig eras; now niche due to TrueType/OpenType prevalence.

SEE ALSO

bdftopcf(1), pcftodump(1), xfs(1), pcf(5)

Copied to clipboard