The IBM selectric, replicated in troff/groff

How to add Letter Gothic and other fonts to the classic UNIX typesetter tool

Mario Emmanuel
The Console
5 min readOct 13, 2023

--

Historical image from IBM Selectric fonts

The 1960s IBM Selectric

The IBM Selectric typewriter, unveiled in 1961, marked a revolutionary departure from traditional typewriters of the era. With its groundbreaking “golf ball” element, which rotated and pivoted to strike the ribbon, it obliterated the issue of jammed keys and elevated the speed and efficiency of typing to unprecedented levels. Its mechanical precision and robust design made it the go-to choice for businesses, heralding a new age of documentation and data entry.

The IBM Selectric

The Selectric wasn’t merely a typewriter; it was a harbinger of the information age, laying foundational frameworks for word processing and even early computing systems. In a world that had yet to experience digital ubiquity, the IBM Selectric was a transformative asset, shaping how businesses and professionals approached tasks that required textual precision.

Letter Gothic

In the golden era of the IBM Selectric, the Letter Gothic typeface emerged as a paragon of clarity and efficiency, tailor-made for the demands of technical and tabular documentation. Designed specifically for use on the Selectric and its successors, Letter Gothic offered monospaced characters, ensuring that each letter occupied the same horizontal space. This uniformity was invaluable for engineers, data analysts, and financial experts who required precise alignment of text and numbers in their reports.

Photo from NASA Archives, public source.

The typeface’s reach extended even into the echelons of space exploration; NASA, during its seminal Apollo missions, relied on IBM Selectrics and fonts like Letter Gothic for mission-critical documentation, briefings, and internal communications. IBM was a major contractor for NASA, and the use of a standardized, highly-readable font like Letter Gothic provided the necessary textual precision for the high-stakes, data-dense world of sending humans to the moon. With its clean, unobtrusive design, Letter Gothic facilitated quick scanning and easy comprehension, thereby reducing cognitive load — a crucial factor in any high-stakes environment. Thus, in a symbiotic relationship with the Selectric, Letter Gothic not only became a staple in technical reporting but also played an essential role in standardizing the visual language of professional documentation during a formative period in information technology and space exploration.

A brief history of Troff

Introduced in the early 1970s, troff (short for "typesetter runoff") originated from a specific need within AT&T: to streamline the document preparation tasks of their patent department. This context lends particular insight into its robust capabilities for formatting complex documents, including legal texts laden with technical details. Integrated into AT&T's UNIX operating system and its Programmer's Workbench, a UNIX-based development environment, troff quickly transcended its initial application to become a bedrock tool for software developers and system administrators. Its programmable nature, coupled with the ability to handle equations, tables, and formatted text, made it indispensable for generating software documentation and technical papers. Despite its specialized origin, troff set a standard for programmable document processing. While it may have been eclipsed by more modern, user-friendly tools, troff endures, particularly in UNIX-based systems and environments that appreciate automation and extensibility. Thus, troff remains a historical milestone and an ongoing resource for technical experts seeking a granular level of control over document creation and formatting.

Installing new fonts in Troff/Groff

In the realm of UNIX-based systems like FreeBSD, adding a custom font to groff—the GNU version of troff—is a relatively straightforward process, which allow to blend legacy typesetting power with contemporary aesthetics. To incorporate a font, follow these steps:

  1. Begin by downloading the desired font in TTF format.
  2. Use a converter like fontforge to transform the font into Adobe Font Postscript Type 1. Within fontforge, change the font encoding to Adobe Standard and then export the font to Postscript Type 1, which will generate a set of .afm and .pfa files.
  3. Use afmtodit command to generate the necessary groff font description afmtodit -e /usr/local/share/groff/current/font/devps/text.enc LetterGothicStd.afm /usr/local/share/groff/current/font/devps/generate/text.map LSG.Here, LGS is the font code name that will be used to reference the font in groff
  4. Transfer the generated LGS, .afm, and .pfa files to /usr/local/share/groff/current/font/devps/.
  5. Update the DESC file located at /usr/local/share/groff/1.23.0/font/devps/ to include your new font fonts 9 0 0 0 0 SS S ZD ZDR LG This involves incrementing the number of installed fonts and replacing a 0 with the new font's identifier (LGS in this example).
  6. Update /usr/local/share/groff/current/font/download. Remember to include the name of the font as it is described in the .pfa file.

Once these steps are complete, the new font can be invoked in your groff documents using the command .ft LGS.

This blend of old and new—legacy typesetting prowess complemented by modern fonts—exemplifies the enduring flexibility and utility of groff in technical documentation.

A side note to import all font variations

The complete process would involve importing the four typical fonts used in groff (R — Roman, I — Italic, B — Bold, BI — Bold Italic). So in reality you would repeat the process four times using the adequate variations of the fonts and generating the files (LGSR, LGSI, LGSB and LGSBI) following the exact procedure above described.

Some extra links

If you are interested in 1960/1970s technical typography you might like the following references:

--

--