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: G. Branden Robinson
Subject: Re: drawing commands have no impact on diversion height
Date: Thu, 8 Jun 2023 20:30:53 -0500

Hi Steve,

At 2023-06-08T14:29:04-0400, Steve Izma wrote:
> I haven't seen any responses to this yet, but it seems pretty
> important to me.

Thanks for following up on this.  How has this never bitten anyone?

> 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].
[...]
> .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.

Maybe we should warn about this; see below.

> *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

There might be a confounding factor.  Note the part about diversions.

5.11 Manipulating Spacing
=========================

A break causes the formatter to update the vertical drawing position at
which the new text baseline is aligned.  You can alter this location.

 -- Request: .sp [distance]
     Break and move the next text baseline down by DISTANCE, or until
     springing a page location trap.(1)  (*note Manipulating
     Spacing-Footnote-1::) If invoked with the no-break control
     character, 'sp' moves the pending output line's text baseline by
     DISTANCE.  A negative DISTANCE will not reduce the position of the
     text baseline below zero.  Inside a diversion, any DISTANCE
     argument is ignored.  The default scaling unit is 'v'.  If DISTANCE
     is not specified, '1v' is assumed.

But I'll bet that's only an annoying wrinkle, and diversion height still
does not reckon with font height manipulation or drawing commands at
all.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

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