groff
[Top][All Lists]
Advanced

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

Re: drawing commands have no impact on diversion height


From: Steve Izma
Subject: Re: drawing commands have no impact on diversion height
Date: Thu, 8 Jun 2023 14:29:04 -0400

On Fri, Jun 02, 2023 at 01:35:22PM -0500, G. Branden Robinson wrote:
> Subject: drawing commands have no impact on diversion height
> 
> I find myself offended by the fact that \D drawing commands update the
> diversion width register `dl`, but have no impact on the diversion
> height register `dn`.
> 
> Nevertheless, all of DWB 3.3, Heirloom Doctools, and GNU troff behave
> this way.
> 
> But it seems pretty unhelpful to me.  If a drawing command inside a
> diversion increases its maximum vertical extent, the formatter should
> tell me that, but it doesn't.  Instead it appears to count only text
> baselines.
> 
> Can someone defend this behavior?

I haven't seen any responses to this yet, but it seems pretty
important to me.

As far as I can tell, the height of a diversion is only
calculated by \n[.v] values. If spacing is reversed within the
diversion and the end of the diversion occurs before the
high-water mark in the diversion, \n[dn] seems to contain only
the difference between the vertical starting point of the
diversion and the vertical position of the last output line.

Nothing I tried with either \D commands or even \H (to
artificially increase the height of the current font) made a
difference to the value of \n[dn]; it only registered values in
terms of \n[.v].

I modified the following for testing:

> Hello, world.
> .sp
> Pardon me a moment while I create a diversion.
> .br
> .di DD
> \D'c 1i'
> .br
> .di
> Okay, I'm back.
> .sp
> Now, let's have a look at that diversion;
> it's \n(dn tall by \n(dl wide. \" 12000, 72000 in PostScript
> .sp 0.5i-0.5v
> .DD
> .sp 0.5i
> All done.

------------------------------------------------------------
.sp 1i
Hello, world.
.sp
Pardon me a moment while I create a diversion.
.br
.di DD
' \" \D'c 1i'
.nf
\H'72'This is a test.\H'0'
Line 2 of this test.
.sp -2v
Line 3 of this test.
.br
.di
.fi
Okay, I'm back.
.sp
Now, let's have a look at that diversion;
it's \n(dn tall by \n(dl wide. \" 12000, 72000 in PostScript
.sp 0.5i-0.5v
.DD
This line starts after the output of the diversion.
.sp 0.5i
All done.
------------------------------------------------------------

Note the .sp -2v, which caused the diversion to end above the
high-water mark and resulted in \n[dn] registering only 1 line
height.

*But* the ending of the diversion seemed to swallow the EOL of
the diversion's last output line, or the .br, or something. As a
result, the first line after the diversion acts as if it's a
continuation of the input to the diversion (see attached PS
file). If I add a .br immediately after the .DD, I get the
expected results, but that seems unnecessary and unpredictable to
me, almost as if a .chop got silently applied by .di

Using groff 1.22.4 on Debian Bullseye.

        -- Steve


-- 
Steve Izma
-
Home: 35 Locust St., Kitchener, Ontario, Canada  N2H 1W6
E-mail: sizma@golden.net  phone: 519-745-1313
cell (text only; not frequently checked): 519-998-2684

==
The most erroneous stories are those we think we know best – and
therefore never scrutinize or question.
    -- Stephen Jay Gould, *Full House: The Spread of Excellence
       from Plato to Darwin*, 1996

Attachment: test.ps
Description: PostScript document


reply via email to

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