Package: groff-base
Version: 1.22.4-6
Severity: normal

Dear Maintainer,

The weird spacing on Pqs when compared to ()s has always bugged me,
but now it's bugged me so hard I decided to look.

You may have noticed that, for example,
  (ibid)
is rendered differently from
  .Pq ibid

It's very obvious when you have both styles stacked together,
or even when you compare stacking punctuation at the end of a Sy-style
macro against Pqing it, and it looks pretty ass.

To ensure this isn't just placebo, here's three troff sessions:
-- >8 --
$ troff -mdoc
(ibid)
x T ps
x res 72000 1 1
x init
p1
x font 5 TR
f5
s10000
V12000
H72000
md
DFd
t(ibid)
n12000 0
x trailer
V792000
x stop

$ troff -mdoc
.Pq ibid
x T ps
x res 72000 1 1
x init
p1
V12000
H72000
DFd
x font 5 TR
f5
s10000
h1666
md
t(
h1666
tibid
h1666
t)
h1666
n12000 0
x trailer
V792000
x stop

$ troff -mdoc
.No ( ibid )
x T ps
x res 72000 1 1
x init
p1
x font 5 TR
f5
s10000
V12000
H72000
md
DFd
t(ibid)
n12000 0
x trailer
V792000
x stop
-- >8 --

"(ibid)" and ".No ( ibid )" yield just "(ibid)",
".Pq ibid" adds 'h' (horizontal motion?).
If we insert some spaces, we get:
-- >8 --
$ troff -mdoc
(\|ibid\|)
x T ps
x res 72000 1 1
x init
p1
x font 5 TR
f5
s10000
V12000
H72000
md
DFd
t(
h1666
tibid
h1666
t)
n12000 0
x trailer
V792000
x stop
-- >8 --
i.e. ".Pq ibid" is "(\|ibid\|)", so with ⅙m space around the text. Huge.

This doesn't seem to be an inherent limitation of groff/mdoc,
and instead appears to be explicit in
  /usr/share/groff/1.22.4/tmac/mdoc/doc-ditroff
as doc-left-parenthesis (and doc-left-bracket for B[qoc],
and the -right- variants, naturally).

As a test, I've removed these spaces from the strings,
and run off three copies of a monograph:
  * job 3300 is stock groff
  * job 3301 has \|s removed from doc-*-parenthesis
  * job 3302 has \^s removed from doc-*-bracket
which are available for comparison at
  https://lfs.nabijaczleweli.xyz/0012-groff-mdoc-*q-spacing

I especially direct your attention to pp. 4, 6, 7, 9, 10, 12, 14, 15;
this is especially egregious in the big paragraph on page 10, which no
longer consists of 20% blank space.

For Bq, I find the last paragraph of page 68 very illustrative
(and the SYNOPSIS looks markedly better, too).

In groff, these blame back to the original mdoc rewrite in 2001ish,
and are blindly copied from 4.4BSD-Lite2:
-- >8 --
usr/src/share/tmac/doc-nroff:.ds lP \fR\|(\fP
usr/src/share/tmac/doc-nroff:.ds rP \fR\|)\fP
usr/src/share/tmac/doc-nroff:.ds lB \fR\|[\|\fP
usr/src/share/tmac/doc-nroff:.ds rB \fR\|]\fP
usr/src/share/tmac/doc-ditroff:.ds lP \fR\|(\|\fP\s10
usr/src/share/tmac/doc-ditroff:.ds rP \fR\|)\|\fP\s10
usr/src/share/tmac/doc-ditroff:.ds lB \fR\^[\^\fP\s10
usr/src/share/tmac/doc-ditroff:.ds rB \fR\^]\fP\s10
-- >8 --

None of the other encapsulation macros I found in
  /usr/share/groff/1.22.4/tmac/mdoc/doc.tmac
have these spaces, and for comparison Op has them (in groff and 4.4BSD)
but Oo and Oc don't (likewise),
so this reads to me like compensation for like deficient font metrics
on the phototypesetters of yore? or something?

It'd be great if you could consider dropping them :)

Best,
наб

-- System Information:
Debian Release: 11.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-17-amd64 (SMP w/24 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FIRMWARE_WORKAROUND, 
TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages groff-base depends on:
ii  libc6         2.31-13+deb11u4
ii  libgcc-s1     10.2.1-6
ii  libstdc++6    10.2.1-6
ii  libuchardet0  0.0.7-1

groff-base recommends no packages.

Versions of packages groff-base suggests:
ii  groff  1.22.4-6

-- no debconf information

Attachment: signature.asc
Description: PGP signature

Reply via email to