Following up...

I've researched this issue to my satisfaction, even though I couldn't
get John Garnder's node.js-based V7 troff output decoder working in an
environment available to me.

I've also some up with a better demonstration, which illustrates
Tadziu's point clearly.  You can find the following attachments, in the
spirit of "show, don't tell".

1. the input demo file
2. groff-generated PostScript output from that input file
3. Heirloom Doctools troff-generated PostScript output from that input
   file
4. a screenshot of 2
5. a screenshot of 3

So, I'll be fixing groff(7) and changing our Texinfo manual to align
with it.

That leaves only the apparent baseline discrepancy between groff and
Heirloom.

At 2021-11-18T10:31:00+0000, Bjarni Ingi Gislason wrote:
> On Thu, Nov 18, 2021 at 03:23:39PM +1100, G. Branden Robinson wrote:
> [...]
> > 
> > Anyone feel game to tackle the groff/Heirloom baseline rule
> > discrepancy?  :D
> 
>   The difference is caused by a defective viewer.

I was skeptical of this claim and I believe I was right to be so.

If you look at the device-independent output generated by groff and
Heirloom Doctool troff, respectively, you will see that they approach
the problem of drawing a baseline rule across the page quite
differently.

Here's the input in question.

        \l"\n(.lu"\h"|0"\c

groff produces a series of line-drawing commands.

[...]
        H72000
        Dl 5000 0
        H75000
        Dl 5000 0
        Dl 5000 0
        Dl 5000 0
[repeated many times]

Heirloom Doctools troff writes baseline rule _glyphs_.

[...]
        x font 9 S1
[...]
        H720
        f9
        V600
        Cru
        h30Cru
        h50Cru
        h50Cru
        h50Cru
        h50Cru
[repeated many times]

I'm including two more attachments, the device-independent output of
groff and Heirloom Doctools troff, to further illustrate this.

Unfortunately, on Heirloom, the 'ru' glyph drawn from the 'S1' font
doesn't appear to really sit on the baseline.  As far as my eyes can
tell, it's identical to the '_' glyph, but not the 'ul' glyph (which
sits even lower).

In groff, all three glyphs are distinguishable on typesetter devices,
and the following input arranges them in descending order (on terminals,
they're all the same: '_').

        A\C'ru'_\C'ul'B

This seems like a bug in Heirloom Doctools troff to me, but given that
code base's provenance, it's easily possible that it's better aligned
with AT&T troff behavior.  (Does someone know?)

One could also argue, maybe, that the \l (and \L) escape sequences
should not be translated to drawing commands in the device-independent
output, but should instead honor their nroff heritage and draw a series
of glyphs (as they still do if given a second argument).  In
groff_char(7), though, we document the baseline rule as a font-invariant
glyph (meaning that it's rendered using drawing commands).

Regards,
Branden

Attachment: vertical-motions.roff
Description: vertical-motions.roff

Attachment: vertical-motions-groff.ps
Description: vertical-motions-groff.ps

Attachment: vertical-motions-heirloom.ps
Description: vertical-motions-heirloom.ps

x T ps
x res 72000 1 1
x init
p1
x font 5 TR
f5
s10000
V12000
H72000
md
DFd
tT
H77410
testing
wh2500
tv
H108650
tertical
wh2500
tmotions:
wh2500
t*
x font 40 TI
f40
tr
H182090
tof
H189690
tf
wf5
h2500
tv
H199820
tersion
wh2500
t1
wh2500
t.
wh2500
t23
wh2500
t.
wh2500
t0
n12000 0
V24000
H72000
t\d\r\d
h86330
t\d\u\u\d
h76880
t\v"0.5m"\v"-1m"\d
h31950
t\v"0.5v"\v"-1v"\d
n12000 0
V60000
H72000
Dl 5000 0
H75000
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
H72000
tfoo
v5000
tbar
V55000
tbaz
v5000
tqux
h53020
tfoo
v5000
tbar
V55000
tbaz
v5000
tqux
h53020
tfoo
v5000
tbar
V55000
tbaz
v5000
tqux
h53020
tfoo
v6000
tbar
V54000
tbaz
v5000
tqux
n12000 0
V120000
H72000
Dl 5000 0
H75000
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
Dl 5000 0
H72000
tfoo
v5000
tbar
V115000
tbaz
v5000
tqux
h53020
tfoo
v5000
tbar
V115000
tbaz
v5000
tqux
h53020
tfoo
v5000
tbar
V115000
tbaz
v5000
tqux
h53020
tfoo
v18000
tbar
V102000
tbaz
v5000
tqux
n36000 0
x trailer
V792000
x stop
x T post
x res 720 1 1
x init
V0
p1
x font 1 R
x font 2 I
x font 3 B
x font 4 BI
x font 5 CW
x font 6 H
x font 7 HB
x font 8 HX
x font 9 S1
x font 10 S
s10
f1
x X LC_CTYPE en_US.UTF-8
H720
V120
cT
61e44s39t28i28n50gw83v50e44r33t28i28c44a44lw61m78o50t28i28o50n50s39:w61*f2
50r39o50f28fwf1
61v50e44r33s39i28o50nw833501500509w83.w580w83.w58850.257507n120 0
H720
f9
V240
c\
f1
28df9
50\f1
28rf9
33\f1
28df9
h913c\
f1
28df9
50\f1
28uf9
50\f1
28uf9
50\f1
28df9
h818c\
f1
28vf9
50"f1
41050.25550mf9
78"41\f1
28vf9
50"f1
41-33150mf9
78"41\f1
28df9
h368c\
f1
28vf9
50"f1
41050.25550vf9
50"41\f1
28vf9
50"f1
41-33150vf9
50"41\f1
28dn120 0
H720
f9
V600
Cru
h30Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
f1
H720
cf
33o50oV650
50b50a44rV550
33b50a44zV600
44q50u50xh582cf
33o50oV650
50b50a44rV550
33b50a44zV600
44q50u50xh582cf
33o50oV650
50b50a44rV550
33b50a44zV600
44q50u50xh582cf
33o50oV660
50b50a44rV540
33b50a44zV590
44q50u50xn120 0
H720
f9
V1200
Cru
h30Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
h50Cru
f1
H720
cf
33o50oV1250
50b50a44rV1150
33b50a44zV1200
44q50u50xh582cf
33o50oV1250
50b50a44rV1150
33b50a44zV1200
44q50u50xh582cf
33o50oV1250
50b50a44rV1150
33b50a44zV1200
44q50u50xh582cf
33o50oV1380
50b50a44rV1020
33b50a44zV1070
44q50u50xn360 0
x trailer
V7920
x stop

Attachment: signature.asc
Description: PGP signature

Reply via email to