groff
[Top][All Lists]
Advanced

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

drawing commands in groff(7) (was: undiagnosed pic error)


From: G. Branden Robinson
Subject: drawing commands in groff(7) (was: undiagnosed pic error)
Date: Tue, 6 Jun 2023 15:07:07 -0500

[self-follow-up]

At 2023-06-05T20:57:37-0500, G. Branden Robinson wrote:
> Hi Doug,
> 
> At 2023-06-05T19:48:50-0400, Douglas McIlroy wrote:
> > > I understand that groff has the \D escape which allows you, among
> > > other things, to draw outline and filled polygons.
> > 
> > Very helpful. I rely on the old testament book of Ossanna and on
> > groff(7), neither of which cover that option for \D. One must look
> > in "info groff". I hope Branden's extensive edits to groff(7) for
> > 1.23 may correct my myopia.
> 
> Regrettably, not yet.  I've been kicking that can down the road [...]

Here's my first cut of this.

  Drawing commands
    Drawing commands direct the output device to render geometrical
    objects rather than glyphs.  Specific devices may support only a
    subset, or may feature additional ones; consult the man page for the
    output driver in use.  Terminal devices in particular implement
    almost none.

    Rendering starts at the drawing position; when finished, the drawing
    position is left at the rightmost point of the object, even for
    closed figures, except where noted.  GNU troff draws objects with
    the selected stroke color; the interior of solid ones is shaded with
    the fill color.  See section "Colors" above.  Coordinates h and v
    are horizontal and vertical motions relative to the drawing position
    or previous point in the command.

    \D'~ h1 v1 ... hn vn'
        Draw B-spline to each point in sequence, leaving drawing
        position at (hn, vn).
    \D'a hc hv h v'
        Draw circular arc centered at (hc, vc) from the drawing position
        to (h, v).
    \D'c d'
        Draw circle of diameter d with its leftmost point at the drawing
        position.
    \D'C d'
        As \D'C', but the circle is solid.
    \D'e h v'
        Draw ellipse of diameter d with its leftmost point at the
        drawing position.
    \D'E h v'
        As \D'e', but the ellipse is solid.
    \D'l h v'
        Draw line from the drawing position to (h, v).
    \D'p h1 v1 ... hn vn'
        Draw polygon with vertices at drawing position and each point in
        sequence.  GNU troff closes the polygon by drawing a line from
        (hn, vn) back to the initial drawing position.  Afterward, the
        drawing position is left at (hn, vn).
    \D'P h1 v1 ... hn vn'
        As \D'p', but the polygon is solid.
    \D't n'
        Set line thickness of geometric objects to to n basic units.  A
        zero n selects the minimal supported thickness.  A negative n
        selects a thickness proportional to the type size; this is the
        default.

Comments?

How was one supposed to draw a "skewed" ellipse in AT&T troff?  That is,
one with its axes rotated non-orthogonally?

Was any consideration given to elliptical arcs?  (Maybe there is a
straightforward transformation of these to B-splines.  I don't feel I
understand B-splines very well.)

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

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