pnmtofstop
Convert PNM images to FACIT printer format
SYNOPSIS
pnmtofstop [-alpha | -antialias | -invert | -width=N | -height=N] [pnmfile]
PARAMETERS
-alpha
Outputs PostScript code for an alpha channel bitmap instead of a monochrome bitmap.
-antialias
Uses grayscale values to produce an antialiased PostScript bitmap, implying -alpha.
-invert
Inverts the colors of the image; black becomes white and white becomes black.
-width=N
Scales the output bitmap to be exactly N pixels wide. Aspect ratio may not be preserved unless -height is also used appropriately.
-height=N
Scales the output bitmap to be exactly N pixels high. Aspect ratio may not be preserved unless -width is also used appropriately.
pnmfile
The input PNM format image file (PBM, PGM, or PPM). If omitted, pnmtofstop reads from standard input.
DESCRIPTION
pnmtofstop is a utility from the Netpbm image manipulation suite that transforms a Portable Anymap (PNM) image into a PostScript "stop" operator string. This output is specifically designed for defining font bitmaps within PostScript, particularly for Adobe Type 1 fonts.
It interprets the pixels of the input PBM, PGM, or PPM image as a monochrome bitmap, where white pixels typically become transparent and black pixels become opaque. The primary use case is to embed raster images as character bitmaps directly into PostScript font definitions, allowing for custom character shapes or specialized symbols to be rendered by a PostScript interpreter.
The command reads a PNM file from its arguments or standard input and writes the generated PostScript `stop` operator string to standard output. This string is not a complete PostScript program but rather a fragment intended to be inserted into a larger font definition script, typically within a `buildchar` procedure. Options allow for handling alpha channels, antialiasing effects, inversion, and scaling of the output bitmap.
CAVEATS
The output of pnmtofstop is a raw PostScript `stop` operator string, not a complete PostScript document. It is designed to be embedded within a larger PostScript font definition. Without -alpha or -antialias, color or grayscale input PNM images are converted to bilevel (black and white) internally using thresholding.
UNDERSTANDING THE "STOP" OPERATOR
In PostScript, the `stop` operator is used within a `buildchar` (or similar character definition) procedure to define the bitmap data for a character. pnmtofstop generates the exact PostScript sequence that represents this bitmap, which then typically follows `buildchar` and precedes the final `end` or `return` statement in a font dictionary.
HISTORY
pnmtofstop is a component of the Netpbm package, a venerable suite of graphics utilities that emerged from the original PBMplus toolkit in the late 1980s/early 1990s. Its development aligns with Netpbm's philosophy of providing small, focused command-line tools for image manipulation. This command specifically addresses the niche requirement of integrating raster images into PostScript font definitions, a task that was particularly relevant in early desktop publishing and custom font creation workflows requiring precise control over character bitmaps.


