bug-groff
[Top][All Lists]
Advanced

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

[bug #62471] [grotty] draws horizontal lines that are too long by 1n


From: G. Branden Robinson
Subject: [bug #62471] [grotty] draws horizontal lines that are too long by 1n
Date: Mon, 16 May 2022 02:14:01 -0400 (EDT)

Update of bug #62471 (project groff):

                Category:        Preprocessor tbl => Device - others/general
                  Status:                    None => In Progress            
             Assigned to:                    None => gbranden               
                 Summary: [tbl] oversets horizontal rules by 1n in nroff mode
=> [grotty] draws horizontal lines that are too long by 1n

    _______________________________________________________

Follow-up Comment #1:

This actually appears to be a bug in grotty(1).  Some kind of rounding
problem?

To produce horizontal rules in tables, tbl(1) produces groff(7) code like
this.


$ grep '\\D' EXPERIMENTS/78-char-table.roff.post-tbl 
\v'.25m'\s[\n[3lps]]\h'|\n[3cd0]u'\D'l |\n[3cd1]u 0'\s0


Notice that we're using \D escape sequences for drawing, not \l for a
horizontal rules.

This comes from single_line_entry::simple_print(). 
https://git.savannah.gnu.org/cgit/groff.git/tree/src/preproc/tbl/table.cpp#n2446

Something interesting happens if you feed groff intermediate output ("grout")
to grotty, varying only the horizontal length parameter to the 'l' drawing
command.

The horizontal motion quantum of the grotty output devices is 24.  That is, 1n
== 1m == 24u.  Watch what happens.


$ cat EXPERIMENTS/horizontal-line-24u.grout 
x T utf8
x res 240 24 40
x init
p1
V40
H0
md
DFd
s10
Dl 24 0
n40 0
x trailer
V2640
x stop
$ ./build/grotty -F ./build/font EXPERIMENTS/horizontal-line-24u.grout | cat
-s
──

$ cat EXPERIMENTS/horizontal-line-12u.grout
x T utf8
x res 240 24 40
x init
p1
V40
H0
md
DFd
s10
Dl 12 0
n40 0
x trailer
V2640
x stop
$ ./build/grotty -F ./build/font EXPERIMENTS/horizontal-line-12u.grout | cat
-s
──

$ cat EXPERIMENTS/horizontal-line-1u.grout 
x T utf8
x res 240 24 40
x init
p1
V40
H0
md
DFd
s10
Dl 1 0
n40 0
x trailer
V2640
x stop
$ ./build/grotty -F ./build/font EXPERIMENTS/horizontal-line-1u.grout | cat
-s
──



No matter how short we make the line, we get two character cells of output.

Something differently curious happens for a zero-length horizontal line, but
I'll leave that for another time because it doesn't seem to be generated by
tbl(1) and thus doesn't hose up man pages.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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