[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #60673] adjustment algorithm should disregard nonadjusted lines in
From: |
Dave |
Subject: |
[bug #60673] adjustment algorithm should disregard nonadjusted lines in its alternation pattern |
Date: |
Tue, 25 May 2021 23:47:21 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0 |
URL:
<https://savannah.gnu.org/bugs/?60673>
Summary: adjustment algorithm should disregard nonadjusted
lines in its alternation pattern
Project: GNU troff
Submitted by: barx
Submitted on: Tue 25 May 2021 10:47:19 PM CDT
Category: Core
Severity: 1 - Wish
Item Group: New feature
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
This was originally reported in a comment in bug #57836, but I now feel it's a
separate enough problem to merit its own bug report.
The text below, mostly unaltered from that previous report, characterizes this
as "grotty" behavior, but it turns out, as Branden explained in bug #60665,
that the relevant code is device independent; it's just that the
line-alternation pattern is effectively invisible in typeset output.
$ nroff tty | uniq
While the example in bug 57836's original report is somewhat
contrived and a bit of an edge case in real life, there turns out
to be a more innate bug in grotty's balancing algorithm. As
mentioned before (and easily observable), when grotty adds spaces
to a line in the process of justifying it, the algorithm it
utilizes adds spaces from opposite ends of each line. But when it
adds this space, it does not take into account lines with no
adjustment at all required. Therefore if space only need be added
to every other line of the text, all the space ends up being
added to the same end of the line, degrading the uniform grayness
of the output, as can be seen in this example. There is one
fairly simple way to address this: grotty shouldn't "count" lines
that don't need to be adjusted; instead, it should apply the
alternation pattern only to those lines that do need adjustment.
$ cat tty
.nh
.ss 12 0
While the example in bug 57836's original report is somewhat
contrived and a bit of an edge case in real life, there turns out
to be a more innate bug in grotty's balancing algorithm. As
mentioned before (and easily observable), when grotty adds spaces
to a line in the process of justifying it, the algorithm it
utilizes adds spaces from opposite ends of each line. But when it
adds this space, it does not take into account lines with no
adjustment at all required. Therefore if space only need be added
to every other line of the text, all the space ends up being
added to the same end of the line, degrading the uniform grayness
of the output, as can be seen in this example. There is one
fairly simple way to address this: grotty shouldn't "count" lines
that don't need to be adjusted; instead, it should apply the
alternation pattern only to those lines that do need adjustment.
$
Here is the same paragraph adjusted by hand using the suggested change to the
algorithm. The overall grayness does not change from one side of the column
to the other as it did before; it's much more pleasing to the eye, while being
no harder (or easier) to read. (If you're reading this in an email client
that uses a proportional typeface, neither example will display properly.
Look at them in the bug tracker.)
While the example in bug 57836's original report is somewhat
contrived and a bit of an edge case in real life, there turns out
to be a more innate bug in grotty's balancing algorithm. As
mentioned before (and easily observable), when grotty adds spaces
to a line in the process of justifying it, the algorithm it
utilizes adds spaces from opposite ends of each line. But when it
adds this space, it does not take into account lines with no
adjustment at all required. Therefore if space only need be added
to every other line of the text, all the space ends up being
added to the same end of the line, degrading the uniform grayness
of the output, as can be seen in this example. There is one
fairly simple way to address this: grotty shouldn't "count" lines
that don't need to be adjusted; instead, it should apply the
alternation pattern only to those lines that do need adjustment.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60673>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [bug #60673] adjustment algorithm should disregard nonadjusted lines in its alternation pattern,
Dave <=