printafm
Print PostScript font metric (AFM) file
SYNOPSIS
printafm <afm_file>
PARAMETERS
<afm_file>
The path to the Adobe Font Metrics (AFM) file whose contents are to be displayed. This file must exist and be readable.
DESCRIPTION
printafm is a utility program designed to read an Adobe Font Metrics (AFM) file and output its detailed contents to standard output in a human-readable format.
AFM files are plain text files that provide critical font metric information for PostScript Type 1 fonts, including character dimensions, kerning pairs, and global font properties. This tool is invaluable for developers, font designers, and system administrators who need to inspect, verify, or troubleshoot font metric data. It allows users to quickly examine properties such as character bounding boxes, font-wide attributes (e.g., FontName, Weight), and kerning adjustments, making it easier to understand how a font is intended to be laid out and rendered by applications.
CAVEATS
printafm has the following considerations:
- Input must be a valid AFM file; malformed files may lead to errors or unexpected output.
- The output is textual and can be extensive for fonts with many characters or complex kerning tables.
- This command is solely for viewing AFM file contents; it does not modify or convert fonts.
AFM FILE FORMAT
Adobe Font Metrics (AFM) files are ASCII text files used to describe the characteristics of Type 1 PostScript fonts. They contain information essential for proper text layout, such as character widths, height, baseline positions, kerning pairs, and bounding boxes for each glyph. Applications like DTP software and PostScript interpreters use AFM files to accurately place characters and lines of text.
OUTPUT DETAILS
The output of printafm includes various sections reflecting the structure of an AFM file. This typically comprises:
Global Font Information: FontName, FullName, Weight, ItalicAngle, BoundingBox for the entire font.
Character Metrics: Detailed information for each character, including its character code (e.g., C 32 for space), character name, width (WX), and bounding box (B).
Kerning Data: Listings of kerning pairs (KPX entries), specifying adjustments between specific character combinations (e.g., for 'VA' or 'Wo').
The textual output can be easily piped to other commands or redirected to a file for further processing or archival.
HISTORY
printafm is typically distributed as part of the Ghostscript suite of utilities, a powerful interpreter for PostScript and PDF languages. Ghostscript's development began in the late 1980s, and accompanying tools like printafm likely emerged to support the growing need for inspecting and understanding font metrics in the PostScript ecosystem. Its fundamental purpose, to provide a plain-text view of AFM data, has remained consistent, serving as a reliable tool for font analysis within the broader PostScript and PDF processing workflows.
SEE ALSO
gs(1), fontconfig(3)