At 2025-06-05T23:24:26-0500, G. Branden Robinson wrote: > I could also extend the `defcolor` request to accept a zero-argument > form that would erase the internal dictionary of defined color names, > restoring the state of the formatter in this respect when launched > with "troff -R".[1] If one hated colors and wanted to make sure a > document didn't use them, the "-wcolor" option plus `.defcolor` at the > top of a document (or in one's "troffrc-end" file), should accomplish > that.
I'm having second thoughts, not about this functionality but about where
to site it. It's important to me that the GNU troff language be
orthogonal and consistent, accepting that due to historical inertia
there are some glitchy exceptions.
It would thus be more consistent with the existing request repertoire to
implement color definition removal with a new request, `rdefcolor`, by
analogy with `rchar` and `rfschar`, and two other removal features I've
mulled over but not implemented, `rhw` and `rev`, for removing
hyphenation exceptions and environments, respectively.
I mildly prefer naming the color-removal request `rcolor`. I feel
like the `defcolor` request name is a wart because the `color` request
for toggling color support arrived around the same time. I'd complain
about that more strongly if I had a better idea what name to give the
latter, but I don't.
This would be easy to do[1] in time for groff 1.24, but I've tried to
restrain myself from adding more features to the formatter at this
point. That said, in a fit of indiscipline and eagerness to aid users,
I recently added yet another debugging/formatter-state-disclosing
request, `pfp`, which lists the mounting positions in use.
groff(7):
.pfp Report, to the standard error stream, the list of
occupied font mounting positions. Occupied mounting
positions are listed, one per line, in increasing
order, followed by the typeface name; if the name
corresponds to an abstract style, the entry ends
there. Otherwise, the name of the font description
file and the font’s “internal name” datum, the meaning
of which varies by output device, follow.
Illustration:
$ echo .pfp | ~/groff-HEAD/bin/groff -T ps
1 R
2 I
3 B
4 BI
5 TR TR Times-Roman
6 CR CR Courier
7 CI CI Courier-Oblique
8 CB CB Courier-Bold
9 CBI CBI Courier-BoldOblique
10 SS SS Symbol-Slanted
11 S S Symbol
12 ZD ZD ZapfDingbats
13 ZDR ZDR ZapfDingbats-Reverse
14 AB AB AvantGarde-Demi
15 ABI ABI AvantGarde-DemiOblique
16 AI AI AvantGarde-BookOblique
17 AR AR AvantGarde-Book
18 BMB BMB Bookman-Demi
19 BMBI BMBI Bookman-DemiItalic
20 BMI BMI Bookman-LightItalic
21 BMR BMR Bookman-Light
22 HB HB Helvetica-Bold
23 HBI HBI Helvetica-BoldOblique
24 HI HI Helvetica-Oblique
25 HR HR Helvetica
26 HNB HNB Helvetica-Narrow-Bold
27 HNBI HNBI Helvetica-Narrow-BoldOblique
28 HNI HNI Helvetica-Narrow-Oblique
29 HNR HNR Helvetica-Narrow
30 NB NB NewCenturySchlbk-Bold
31 NBI NBI NewCenturySchlbk-BoldItalic
32 NI NI NewCenturySchlbk-Italic
33 NR NR NewCenturySchlbk-Roman
34 PB PB Palatino-Bold
35 PBI PBI Palatino-BoldItalic
36 PI PI Palatino-Italic
37 PR PR Palatino-Roman
38 TB TB Times-Bold
39 TBI TBI Times-BoldItalic
40 TI TI Times-Italic
$ echo .pfp | ~/groff-HEAD/bin/nroff
1 R R
2 I I 1
3 B B 2
4 BI BI 3
5 CSH CSH 2
6 CSS CSS
7 CTS CTS
8 CTH CTH 2
9 JPG JPG 2
10 JPM JPM
11 KOG KOG 2
12 KOM KOM
If I could have gotten SunOS troff to tell me something like the
foregoing back in 1993 or so, I might have gotten involved with groff
development many years ago.
Regards,
Branden
[1] famous last words
signature.asc
Description: PGP signature
