groff
[Top][All Lists]
Advanced

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

RE: [Groff] polygon drawing compatibility


From: T. Kurt Bond
Subject: RE: [Groff] polygon drawing compatibility
Date: Tue, 20 Nov 2001 10:18:17 -0500 (EST)

Bernd Warken writes:
> Werner asked me to raise another discussion on the positioning after
> the drawing of a closed polygon.  This is done by the groff-escapes
> `\Dp' and `\DP', and the intermediate output commands `Dp' and `DP'.
[...]
> - there exist different incompatible roff extensions implementing
>   polygon drawing (at least the ditroff above and groff), so there is no
>   single standard that should or could be followed.
> - at least one of these implementations uses the classical positioning
>   rule for its polygons (the ditroff above).
> - both in groff_out and in the ditroff above, the polygons are
>   documented as being only used by preprocessors; groff_out documents
>   pic to circumvent the positioning.

By "classical positioning" you mean "at the end", right?  What should
be "the end" for polygons: (1) at the last point of the drawing, like
splines and lines?  Or (2) at the right side of the drawing, with the
verical position back at the baseline, like circles and ellipses?  Or
(3) something else?

If we follow the example of splines (which also have multiple delta
pairs) we'd choose (1).  But polygons are always closed (even if we
leave off the delta pair that moves back to the start it will
automatically be closed), so if we follow the example of the other closed
shapes, circles and ellipses, we'd choose (2).

For incidental inline use of polygons, (2) is more convenient, since
you just draw the object and continue on with your text without
worrying about getting back to the proper baseline.

For complicated drawings (1) *might* be more convenient.

Either (1) or (2) have the advantage of being consistent, so either
would be preferable to the way groff does it now.

BTW, if you draw an ellipse like \D'e-0.2i -0.1i' with groff 1.16.1 or
1.17.2 the end does *not* end up a the right.  Bug?  Can anyone with
access to the Plan 9 troff tell us what happens in this case?

(Does anyone know if Plan 9 troff had polygons added, and if so, what
their behavior is?)

Here's some groff input for comparing drawing commands:
.\" x.ms -- try some drawing commands.  groff -p -ms x.ms >x.ps
We'll use these labels for reference.
.PS
B: box ht 0.25 wid 0.5 
       "A " at B.nw rjust
       " B" at B.ne ljust 
       " C" at B.se ljust 
       "D " at B.sw rjust
.PE
Here's a circle for comparison: \D'c 0.2i' and some more text.
.sp 1v
Here's an elispse for comparison: \D'e0.2i 0.1i' and some more text.
.sp 1v
Here's another ellipse for comparison (negative delta, so we'll add some extra 
space first and surround with <>):\h'0.5i'<\D'e-0.2i -0.1i'>\h'0.5i' and some 
more text after a horizontal space.
.sp 1v
Note that after '<' is where the ellipse started and '>' is where it ended.
That's not at the right side!  (Bug?)
.sp 1v
How does the polygon look (ABCD): \D'p0.2i 0i   0i 0.1i   -0.2i 0i   0i -0.1i'? 
and some more text.
.sp 1v
Or this polygon (clockwise): \D'p0.2i 0.1i   0.2i -0.1i   -0.2i -0.1i   -0.2i 
0.1i'? and some more text.
.sp 1v
How does the polygon look (ADCB): \D'p0i 0.1i 0.2i 0i 0i -0.1i -0.2 0i'? and 
some more text.
.sp 1v
How does the unfinished polygon look (ABC, three delta pairs specified): 
\D'p0.2i 0i   0i 0.1i   -0.2i 0i'? and some more text.
.sp 2v
Here's another (5 delta pairs specified) unfinished polygon: \D'p0.5i 0.2i   0i 
0.5i   -0.2i 0i   -0.2i -0.2i   -0.2i 0.2i'? and some more text.
.sp 1.5i
Here's another (5 delta pairs specified) unfinished polygon, right to left and 
down to up: \D'p-0.5i -0.2i   -0i -0.5i   0.2i 0i   0.2i 0.2i   0.2i -0.2i'? 
and some more text.
.sp 1v
Here's a line (left to right, up to down): \D'p0.2i 0.1i'? and some more text.
.sp 2v
Here's another line (right to left, down to up): \D'p-0.2i -0.2i'? and some 
more text.
.sp 2v
Here's a bspline (left to right, up to down): \D'~ 0.5i 0.1i   0.1i 0.5i 0.5i 
0.1i'? and some more text.
.sp 1i
Here's a bspline (right to left, down to up): \D'~ -0.5i -0.1i   -0.1i -0.5i 
-0.5i -0.1i'? and some more text.
.sp 1v
This is the end.
.\" eof

-- 
T. Kurt Bond, address@hidden


reply via email to

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