LinuxCommandLibrary

hpftodit

Convert Hewlett-Packard PCL fonts to troff

SYNOPSIS

hpftodit [-a] [-b] [-d] [-h] [-i name] [-m] [-s] [-v] [-x N] [ res ] HPfile [ font ]

PARAMETERS

-a
    Automatically generate kerning pairs (default)

-b
    Include `before ligature' program in definitions (default)

-d
    Dump detailed font statistics

-h
    High resolution mode (1000 dpi)

-i name
    Use name as image file instead of auto-generating

-m
    Disable automatic kerning pairs

-s
    Treat font as symbol font

-v
    Print version and exit

-x N
    Slant uppercase characters N degrees right

DESCRIPTION

hpftodit is a utility in the groff package that converts Hewlett-Packard Tagged Font Metrics files—typically from LaserJet printers—into font description files usable with troff and the -Tlj4 device driver.

It processes the input file to extract character widths, ascents, descents, ligature information, and kerning data, generating a font metrics file (fontname) and optionally referencing bitmap images. This enables precise rendering of HP-specific fonts in groff-generated output, ideal for PostScript or DVI via lj4 emulation.

The tool assumes square pixels unless specified and supports automatic kerning pair generation based on heuristics. Output files are placed in the current directory, ready for inclusion via DESC updates in font directories. Primarily used in Unix typesetting workflows for legacy HP printer fonts, it preserves proprietary metric fidelity for professional documents.

Common workflow: prepare HP font dump, run hpftodit with resolution matching device (e.g., 720 for standard), then install in groff font path.

CAVEATS

Input must be valid HP Tagged Bitmap Font file (e.g., from LaserJet dumps); limited to lj4 device. No vertical slant option. Assumes square pixels; mismatched res may distort metrics.

OUTPUT FILES

Creates font (metrics) and references font.i (images); updates DESC implicitly via devname/DESC.

EXAMPLE USAGE

hpftodit 720 /path/to/Helvetica.m Helvetica
Generates Helvetica font files for 720 dpi lj4 device.

HISTORY

Developed in 1980s for Berkeley ditroff to support HP LaserJet printing. Ported and enhanced in groff by James Clark (1990s); maintains compatibility with original Unix troff fonts.

SEE ALSO

afmtodit(1), addftinfo(1), groff(1), lj4(1)

Copied to clipboard