LinuxCommandLibrary

afmtodit

Convert audio files to text data

SYNOPSIS

afmtodit [-v] [-d download] [-e encode] [-m map] [-o outfile] [-s spacewidth] [-w width] afmfile font

PARAMETERS

-v
    Verbose mode: print processing progress

-d download
    Download encoding file (default: /usr/share/groff/<version>/font/devps/Download)

-e encode
    PostScript encoding file (default: /usr/share/groff/<version>/font/devps/Encode)

-m map
    Metric adjustment map file

-o outfile
    Output width file name

-s spacewidth
    Space character width (default: 0.25 em)

-w width
    Default width for missing characters (default: 0.5 em)

DESCRIPTION

afmtodit is a utility in the groff suite that converts Adobe Font Metrics (AFM) files into font metric files usable by the groff PostScript device (devps). It processes font widths, kerning pairs, and ligatures from AFM data generated by tools like t1utils or Adobe sources.

The command generates a width file named after the specified font argument (e.g., Times-Roman), which gtroff loads for typesetting. It supports custom encodings via -d and -e files, metric adjustments via -m, and overrides for space and default widths. This enables high-quality PostScript output in groff documents.

Common workflow: Extract AFM with t1disasm, run afmtodit, then use addftinfo for PostScript embedding. Primarily for legacy troff/groff users creating custom fonts for man pages, books, or DVI/PS output.

CAVEATS

Assumes AFM uses 1000-unit EM square; ignores some AFM fields like track kerning. Output is device-specific to devps. Not for modern PDF workflows (use fontforge or otf2otf instead).

OUTPUT

Creates font width file with metrics, ligatures, and kern pairs for gtroff -Tps.

EXAMPLE

afmtodit -e /path/Encode Times-Roman.afm Times-Roman
Generates Times-Roman for use in groff -Tps.

HISTORY

Originated in 1980s Berkeley psditroff by Brian Kernighan; ported to groff by James Clark in 1990s. Maintained in GNU groff (>=1.17), with paths updated across versions.

SEE ALSO

addftinfo(1), gtroff(1), pfbtops(1), t1disasm(1)

Copied to clipboard