[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Doubts about a typo fix

From: Paul Eggert
Subject: Re: Doubts about a typo fix
Date: Fri, 25 Nov 2022 18:18:46 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

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

Attachment: 0001-Use-CR-font-instead-of-CW.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]