[tz] Doubts about a typo fix

Paul Eggert eggert at cs.ucla.edu
Sat Nov 26 02:18:46 UTC 2022

Thanks for the info about groff. You're right, tzdb man pages are 
supposed to be portable to both groff and traditional troff. For the 
latter I test with /usr/bin/nroff and /usr/bin/troff on Solaris 10, 
which is the oldest troff I know that is still supported.

On 2022-11-23 13:40, G. Branden Robinson wrote:

> Strictly, this string definition should be updated to use the font's
> minus sign even if the formatter is groff (the `.g` register
> interpolates a true value).
>    .ie \n(.g \{\
>    .  ds : \:
>    .  ds - \f(CW\-\fP
>    .\}

If we did that, Groff would set a source string like "\*-\*-help" as 
"−−help", with two instances of U+2212 MINUS SIGN instead of U+002D 
HYPHEN-MINUS. Therefore people couldn't cut and paste code examples out 
of HTML or PDF, and into the shell.

"\f(CW-\fP" is used instead of plain "-" because when the output is PDF, 
it is more clearly visible to humans as a hyphen-minus instead of as a 
hyphen (U+2010 HYPHEN).

> Most people won't see a difference because groff 1.22.4 (and earlier
> releases going back to, I think, 2009) the man(7) macro package remaps
> the hyphen to the minus sign on the 'utf8' output device. 

I noticed the abovementioned problem with PDF output, and I still see it 
with groff 1.22.4.

I see a different issue with groff 1.22.4 on Ubuntu 22.10: I cannot 
easily see the difference between "\f(CR-\fP" and "\f(CR\-\fP" on output 
to PDF. If I cut from the output PDF and paste into Emacs or the 
terminal, the former is indeed U+002D and the latter U+2202 and the 
difference is readily visible in Emacs or the terminal; but it's not 
readily visible in the PDF. However, this glitch is not a serious issue 
for man pages since examples always contain hyphen-minuses not minus 
signs, so I didn't worry about it. I assume that it's yet another font 
thing, since the problem doesn't occur in the default Roman font.

> I also note that "CW" is an old, AT&T device-independent
> troff-compatible font name.[3]  groff's preferred name for this face is
> "CR", because for the past couple of decades a monospace font (often
> Courier) has generally been available in all four styles (roman,
> oblique, bold, and bold-oblique).

Thanks, I didn't know that was preferred. I installed the attached patch 
into the tzdb development repository
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Use-CR-font-instead-of-CW.patch
Type: text/x-patch
Size: 3381 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20221125/06a5ee92/attachment.bin>

More information about the tz mailing list