Groff Mystery Solved

Published at 01:27 on 14 April 2018

Groff is an old-school text formatter that’s shipped with every Mac. Why? Because Macs are Unix systems under the hood, and the documentation for all the command-line tools is in Groff, because the Unix manuals have always been in Groff (or some very similar predecessor).

Being sort of a diehard, until fairly recently I’ve used Groff for typing letters, a résumé, and such. Why not? I know it, and it still works fine. Why spend time learning something else?

Well, it worked fine until a year or so ago, then I noticed (after upgrading MacOS) that most of the fonts seemed to have vanished. If you’d use a font other than Times Roman, it would tend to just use Times Roman anyhow, but with the spacing of the other font. Total ugly mess.

After ages of wondering what’s up (and doing web search after web search to research the issue), I finally found what Apple broke. Not Groff; it still works fine. It’s the Mac’s built-in PostScript tools that are broken.

Historically, PostScript devices have all supported a set of basic core fonts. Groff as shipped just uses those fonts. It knows their metrics but it has no other data about them. It assumes the device will know how to render them. For some reason, Apple’s pstopdf tool has ceased to support most of those fonts.

The fix is to use install and use Ghostscript, which still knows about the core PostScript fonts. Or, in my case, simply to use Ghostcript, which I had installed some time ago, having used it before I became aware of Apple’s pstopdf tool.

That said, it’s a fairly limited suite of fonts that Groff knows about by default, and it’s a pain to install other ones. Groff doesn’t understand normal TTF or OTF files (in the normal system locations for such installed files) like most other programs do. The tools to generate the files that Groff can understand are both (a) poorly documented, and (b) prone to getting tripped up by anything a font does that’s the least bit unusual (albeit legal and allowed).

Add that to Groff’s extremely limited support for mixing text and illustrations and lack of Unicode support, and it’s time to use something more modern for most purposes. Still, it’s nice to know the trick for getting the system documentation (and my old documents) printing normally again.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.