Re: Doubts about a typo fix

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

 



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
From 220c21f6b4167378f463828e6921c281a85abe1f Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@xxxxxxxxxxx>
Date: Fri, 25 Nov 2022 15:56:52 -0800
Subject: [PROPOSED] Use CR font instead of CW

Suggested by G Branden Robinson in:
https://mm.icann.org/pipermail/tz/2022-November/032336.html
---
 newctime.3    | 2 +-
 newstrftime.3 | 4 ++--
 newtzset.3    | 2 +-
 time2posix.3  | 2 +-
 tzfile.5      | 2 +-
 tzselect.8    | 2 +-
 zdump.8       | 6 +++---
 zic.8         | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/newctime.3 b/newctime.3
index 2907f856..e25d841e 100644
--- a/newctime.3
+++ b/newctime.3
@@ -5,7 +5,7 @@
 asctime, ctime, difftime, gmtime, localtime, mktime \- convert date and time
 .SH SYNOPSIS
 .nf
-.ie \n(.g .ds - \f(CW-\fP
+.ie \n(.g .ds - \f(CR-\fP
 .el .ds - \-
 .B #include <time.h>
 .PP
diff --git a/newstrftime.3 b/newstrftime.3
index d68bc337..d5d8ee10 100644
--- a/newstrftime.3
+++ b/newstrftime.3
@@ -40,7 +40,7 @@
 strftime \- format date and time
 .SH SYNOPSIS
 .nf
-.ie \n(.g .ds - \f(CW-\fP
+.ie \n(.g .ds - \f(CR-\fP
 .el .ds - \-
 .B #include <time.h>
 .PP
@@ -55,7 +55,7 @@ strftime \- format date and time
 .ie '\(rq'' .ds rq \&"\"
 .el .ds rq \(rq\"
 .de c
-.ie \n(.g \f(CW\\$1\fP\\$2
+.ie \n(.g \f(CR\\$1\fP\\$2
 .el \\$1\\$2
 ..
 .de q
diff --git a/newtzset.3 b/newtzset.3
index c3742850..1e75acf0 100644
--- a/newtzset.3
+++ b/newtzset.3
@@ -5,7 +5,7 @@
 tzset \- initialize time conversion information
 .SH SYNOPSIS
 .nf
-.ie \n(.g .ds - \f(CW-\fP
+.ie \n(.g .ds - \f(CR-\fP
 .el .ds - \-
 .B #include <time.h>
 .PP
diff --git a/time2posix.3 b/time2posix.3
index e7c69206..e13c431c 100644
--- a/time2posix.3
+++ b/time2posix.3
@@ -5,7 +5,7 @@
 time2posix, posix2time \- convert seconds since the Epoch
 .SH SYNOPSIS
 .nf
-.ie \n(.g .ds - \f(CW-\fP
+.ie \n(.g .ds - \f(CR-\fP
 .el .ds - \-
 .B #include <time.h>
 .PP
diff --git a/tzfile.5 b/tzfile.5
index 9d312255..c3e86c62 100644
--- a/tzfile.5
+++ b/tzfile.5
@@ -11,7 +11,7 @@ tzfile \- timezone information
 .de q
 \\$3\*(lq\\$1\*(rq\\$2
 ..
-.ie \n(.g .ds - \f(CW-\fP
+.ie \n(.g .ds - \f(CR-\fP
 .el .ds - \-
 The timezone information files used by
 .BR tzset (3)
diff --git a/tzselect.8 b/tzselect.8
index 53a34cf6..846b867b 100644
--- a/tzselect.8
+++ b/tzselect.8
@@ -4,7 +4,7 @@
 .SH NAME
 tzselect \- select a timezone
 .SH SYNOPSIS
-.ie \n(.g .ds - \f(CW-\fP
+.ie \n(.g .ds - \f(CR-\fP
 .el .ds - \-
 .ds d " degrees
 .ds m " minutes
diff --git a/zdump.8 b/zdump.8
index 1ff92639..170e18d6 100644
--- a/zdump.8
+++ b/zdump.8
@@ -18,7 +18,7 @@ zdump \- timezone dumper
 .de q
 \\$3\*(lq\\$1\*(rq\\$2
 ..
-.ie \n(.g .ds - \f(CW-\fP
+.ie \n(.g .ds - \f(CR-\fP
 .el .ds - \-
 The
 .B zdump
@@ -151,7 +151,7 @@ Here is an example of the output, with the leading empty line omitted.
 tabbed columns line up.)
 .nf
 .sp
-.if \n(.g .ft CW
+.if \n(.g .ft CR
 .if t .in +.5i
 .if n .in +2
 .nr w \w'1896-01-13  'u+\n(.i
@@ -184,7 +184,7 @@ UT, a standard time abbreviated HST.
 Here are excerpts from another example:
 .nf
 .sp
-.if \n(.g .ft CW
+.if \n(.g .ft CR
 .if t .in +.5i
 .if n .in +2
 TZ="Europe/Astrakhan"
diff --git a/zic.8 b/zic.8
index 8b77ea12..f345f944 100644
--- a/zic.8
+++ b/zic.8
@@ -24,7 +24,7 @@ zic \- timezone compiler
 .el .ds > \(ra
 .ie \n(.g \{\
 .  ds : \:
-.  ds - \f(CW-\fP
+.  ds - \f(CR-\fP
 .\}
 .el \{\
 .  ds :
-- 
2.37.2


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux