groff
[Top][All Lists]
Advanced

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

RE: [Groff] [Tbl]Controlling line thickness in tbl


From: George, Russell A
Subject: RE: [Groff] [Tbl]Controlling line thickness in tbl
Date: Mon, 03 Dec 2001 07:00:12 -0500

My understanding from the troff tutorial is that 3000u would be 1500 points
or about 20.8 inches assuming a vertical resolution of about 1/2 point. I
assume the vertical resolution is the limitation here since the thickness of
a horizontal line is the issue.

Russell George.

-----Original Message-----
From: address@hidden [mailto:address@hidden
Sent: Friday, November 30, 2001 5:15 AM
To: George, Russell A.
Cc: address@hidden
Subject: RE: [Groff] [Tbl]Controlling line thickness in tbl


On 29-Nov-01 George, Russell A wrote:
> Can the thickness of individual lines be controlled in tbl.

Up to a point.

For the horizontal lines it is fairly straightforward.

First, I think (where PS output is concerned) that it
is worth while setting the "linecap" to 0 (i.e. square
ends not projecting). [Also see comment below.]

Next, you can change the line thickness of succeeding
horizontal lines by planting a \D't ...' in the table.

Try the following:

\X'ps: exec 0 setlinecap'
.TS
tab(#);
c c c c.
_
a#b#c#d
_
a#b#c#d\D't 3000u'\h'-3000u'
a#b#c#d
_
a#b#c#d\D't 100u'\h'-100u'
_
a#b#c#d
_
a#b#c#d
_
.TE

This works because the horizontal lines in the table are
drawn where they are encountered, so you can plant a thickness
change where you need it.

However, this will not work for vertical lines: these are
drawn from top to bottom in left-to-right order after everything
else has been drawn, so I don't see any direct way to intervene
and make them of different thicknesses.

It would in theory be possible to make the change by following
'tbl' in the groff pipeline with a program which could intercept
the output of 'tbl', recognise certain user-defined tags, and
then trap the "\Dl...'" commmands which draw the lines and
embed them in line-thickness changes on the lines of the above.

However, doing this would not be trivial!

COMMENT: By default, the linecap type is "1" -- i.e. rounded
ends of radius half the line thickness. PS has three linecap types:

0: square ends at the defined endpoint of the line
1: round ends (as above)
2: square ends projecting half a line thickness beyond the endpoint.

In my view, linecap=1 is not globally appropriate for tables; it is
particularly suited for smooth joins of line which meet at an angle
other than a right-angle. Since the lines in tables meet at right
angles, this is not needed _except_ in those few places where two
lines form a corner. Usually this is at the corners of an overall
frame.

So long as all the lines are the same thickness, linecap=1 does not
matter much (though if the lines were thick you would see rounded
corners). However, if you are going to change line thickness then
the round cap of horizontal lines will project beyond thinner
vertical lines which pass through their ends, making little bumps.

I think there is scope for a more sophisticated approach to linecap
type in groff, and indeed for a more flexible approach to line
thickness in 'tbl'.

I hope the above is helpful.
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 30-Nov-01                                       Time: 10:15:26
------------------------------ XFMail ------------------------------

reply via email to

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