bug-groff
[Top][All Lists]
Advanced

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

[bug #64142] .spreadwarn undocumentedly converts units to be relative to


From: Dave
Subject: [bug #64142] .spreadwarn undocumentedly converts units to be relative to font size
Date: Wed, 3 May 2023 17:26:19 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?64142>

                 Summary: .spreadwarn undocumentedly converts units to be
relative to font size
                   Group: GNU roff
               Submitter: barx
               Submitted: Wed 03 May 2023 04:26:17 PM CDT
                Category: Core
                Severity: 2 - Minor
              Item Group: Documentation
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Wed 03 May 2023 04:26:17 PM CDT By: Dave <barx>
Experienced roff users expect requests that take numeric values with units to
store those quantities in basic units, so that even if font-size-relative
units were initially specified, subsequent changes to the font size do not
change the magnitude of those stored values.

The .spreadwarn request appears to work in the opposite direction: even if its
parameter is specified as an absolute value (e.g., in inches), it seems to be
stored as a font-relative one, so that it scales to the current font size. 
Examples below illustrate this.

Given what .spreadwarn does, this is a reasonable design, but surprising
compared to how most roff requests work, so should be documented.

.spreadwarn is a groffism, though Heirloom troff has also implemented it.

(Not relevant to this issue, but linked here since I chased it down before
opening this bug: the .spreadwarn documentation was recently updated in
response to bug #58035.)

== Examples ==

$ cat spreadwarn_scaling
.spreadwarn 1
.ll 70p
one two three\p
.ll 75p
one two three\p
.ps 40
.ll 290p
one two three\p
.ll 300p
one two three\p
$ groff -a spreadwarn_scaling
<beginning of page>
one two three
troff: spreadwarn_scaling:5: warning [p 1, 0.2i]: spreading 1.0335m per space
one two three
one two three
troff: spreadwarn_scaling:10: warning [p 1, 0.5i]: spreading 1.0335m per
space
one two three

The lack of a warning above about the third output line is mildly surprising,
given the way many requests taking a parameter in ems (.spreadwarn's default)
store it as an absolute value.  But more surprising (to me) is that this still
holds when explicitly providing an invariant unit as the parameter:

$ sed 's/spreadwarn 1/spreadwarn 0.14i/' spreadwarn_scaling | groff -a
<beginning of page>
one two three
troff: <standard input>:5: warning [p 1, 0.2i]: spreading 1.0335m per space
one two three
one two three
troff: <standard input>:10: warning [p 1, 0.5i]: spreading 1.0335m per space
one two three

Both 40-point output lines have well over 0.14 inches of space added, but
still only the last gets the warning, as only that one exceeds the threshold
in ems.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64142>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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