n-t-roff / heirloom-doctools

The Heirloom Documentation Tools: troff, nroff, and related utilities
http://n-t-roff.github.io/heirloom/doctools.html
Other
126 stars 23 forks source link

Broken L/LS/LB in ms macros #66

Closed fscoto closed 6 years ago

fscoto commented 6 years ago

The ms macros feature macros L/LS/LB for (I presume source code, going by the lack of italics) listings. When trying to use them with troff -ms test.troff | dpost, however, the following output is displayed:

troff: Can't load font /usr/local/ucblib/doctools/font/devps/L; line 1, file test.roff; page 1
troff: Can't load font /usr/local/ucblib/doctools/font/devps/L; line 1, file test.roff; page 1
LS
troff: Can't load font /usr/local/ucblib/doctools/font/devps/L; line 1, file test.roff; page 1
LS
troff: Can't load font /usr/local/ucblib/doctools/font/devps/L; line 5, file test.roff; page 1
L
troff: Can't load font /usr/local/ucblib/doctools/font/devps/L; line 5, file test.roff; page 1
L
troff: Can't load font /usr/local/ucblib/doctools/font/devps/LB; line 7, file test.roff; page 1
LB
troff: Can't load font /usr/local/ucblib/doctools/font/devps/LB; line 7, file test.roff; page 1
LB

This is the test file:

.LS
This is broken.
.LE
So is
.L this .
And
.LB this
as well.

The issue can be mitigated by prefixing the test file with:

.fp L CW
.fp LB CB

I'm not sure if this is the right way to go about this, however.


The L/LS/LB macros seem to originate from heirloom-doctools, which in turn got them from OpenSolaris, where they have been since its inception 2005. OpenSolaris did not document these macros.

They are missing in groff, DWB3.3 and 4.4BSD. They may have been undocumented extensions in the Solaris line. heirloom-doctools contains no documentation for ms at all.


Is it intended behavior that the fonts are not mounted so that users can set them explicitly?

If this is unintended behavior: should the macros be removed? Should the L and LB fonts be mounted by default when using the ms macros instead and if so, how? Should the L and LB fonts be changed to references to C and CB instead?

If this is intended behavior, where should it be documented?

fscoto commented 6 years ago

I have done some more research on this. The L and LI fonts existed in UNIX V7 and 4BSD. Apparently, L was "Geneva Light". The font disappeared between 4.1BSD and 4.1cBSD from at least some distributions.

Most likely, the listing macros still reference this dead font for historical reasons, lost somewhere in the long trails of the past. It seems to be that the ideal solution is to change the macros to use H (Helvetica) instead. It's the closest equivalents to L and LI. Helvetica was also used in S. R. Bourne, The UNIX System, London 1984 for listings. Font licensing is a hairy topic; getting a hold of a suitable version of Geneva (Light) is most likely not a realistic option.