diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-02-16 19:49:58 +1100 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-02-21 22:03:21 +1100 |
commit | 15f8188656ef0ebed797eb5981b012b590fc77ad (patch) | |
tree | 91916ada53163d79f65b5b8249549a0e13227336 /tmac/an-ext.tmac | |
parent | cf91ca69f8af3d13f6b004556c2310b5102aae91 (diff) | |
download | groff-git-15f8188656ef0ebed797eb5981b012b590fc77ad.tar.gz |
[man]: Refactor `EX` and `EE` macros.
* tmac/an-ext.tmac: Add new `mC` string to store the font name to be
used for example regions. In AT&T device-independent troff, "CW" was
a common name, so use that. It is however a terrible fit for groff's
font family and style-combination functionality, and is inflexible in
the face of font selection requests and escape sequences within the
example region. (One either needs to know the names of the fonts
available on the output device, or suffer the indignity of mixed
constant-width and proportional typefaces.) Relatedly, drop
groff-specific font remapping requests.
(EX, EE): Ignore definition if GNU troff is the formatter. Drop font
family manipulation. Drop specialized logic for groff's DVI output
device.
* tmac/an.tmac (initialization): Resurrect font remapping requests here.
(EX, EE): Add new definitions, saving and restoring more state and
remapping DVI output device fonts to reflect the absence of CWB and
CWBI faces.
Diffstat (limited to 'tmac/an-ext.tmac')
-rw-r--r-- | tmac/an-ext.tmac | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/tmac/an-ext.tmac b/tmac/an-ext.tmac index 15011e53a..0ddf29d34 100644 --- a/tmac/an-ext.tmac +++ b/tmac/an-ext.tmac @@ -27,6 +27,9 @@ .if \n(mX>1 \ . nx . +.\" Define this to your implementation's constant-width typeface. +.ds mC CW +. .\" In AT&T troff, there was no register exposing the hyphenation mode, .\" and no way to save and restore it. Set this to a reasonable value .\" for your implementation and preference. @@ -54,14 +57,6 @@ .\} . . -.\" Map mono-width fonts to standard fonts for groff's TTY device. -.if n \{\ -. do ftr CR R -. do ftr CI I -. do ftr CB B -. do ftr CBI BI -.\} -. .\" groff has glyph entities for angle brackets. .ie \n(.g \{\ . ds mL \(la\" @@ -238,27 +233,21 @@ . . .\" Start example. +.if \n(.g .ig .de EX -. do ds mF \\n[.fam] . nr mE \\n(.f -. nr mP \\n(PD \" Save paragraph distance. +. nr mP \\n(PD . nr PD 1v . nf -. \" Work around Savannah #59522. -. ie !'\\*[.T]'dvi' \{\ -. do fam C -. ft R -. \} -. el \ -. ft CW +. ft \\*(mC .. . . .\" End example. +.if \n(.g .ig .de EE -. do fam \\*(mF . ft \\n(mE -. nr PD \\n(mP \" Restore paragraph distance. +. nr PD \\n(mP . fi .. . |