Drawing Requests
================
`gtroff' provides a number of ways to draw lines and other figures
on the page. Used in combination with the page motion commands (see
Note:Page Motions, for more info), a wide variety of figures can be
drawn. However, for complex drawings these operations can be quite
cumbersome, and it may be wise to use graphic preprocessors like `gpic'
or `ggrn'. Note:gpic, and Note:ggrn, for more information.
All drawing is done via escapes.
- Escape: \l'L C'
Draws a line rightwards from the current location. The full
syntax for this escape is:
\l'LC'
where L is the length of the line to be drawn, starting at the
current location; positive numbers draw to the right, and negative
numbers draw towards the left. This can also be specified
absolutely (i.e. with a leading `|') which draws back to the
beginning of the line.
The optional second parameter C is a character to draw the line
with. If this second argument is not specified, `gtroff' uses the
underscore character.
To separate the two arguments (to prevent `gtroff' from
interpreting a drawing character as a scaling indicator) use `\&'.
Here a small useful example:
.de box
\(br\\$*\(br\l'|0\(rn'\l'|0\(ul'
..
Note that this works by outputting a box rule (a vertical line),
then the text given as an argument and then another box rule.
Then the line drawing escapes both draw from the current location
to the beginning of the _input_ line.
- Escape: \L'L C'
Draws vertical lines. Its parameters are similar to the `\l'
escape. The movement is downwards for positive values, and
upwards for negative values. The default character is the box
rule character. As with the vertical motion escapes, text
processing blindly continues where the line ends.
- Escape: \D'COMMAND ARG ...'
The `\D' escape provides a variety of drawing functions. While
the previous escapes work on a character device, these escapes do
not.
`\D'l DX DY''
Draw a line from the current location to the relative point
specified by (DX,DY).
`\D'c D''
Draw a circle with a diameter of D with the leftmost point at
the current position.
`\D'C D''
Draw a solid circle with the same parameters as an outlined
circle.
`\D'e DX DY''
Draw an ellipse with a horizontal diameter of DX and a
vertical diameter of DY with the leftmost point at the
current position.
`\D'E DX DY''
Draw a solid ellipse with the same parameters as an outlined
ellipse.
`\D'a DX1 DY1 DX2 DY2''
Draw an arc clockwise from the current location through the
two specified locations (DX1,DY1) and (DX2,DY2).
`\D'~ DX1 DY1 DX2 DY2 ...''
Draw a spline from the current location to (DX1,DY1) and then
to (DX2,DY2), and so on.
`\D'f N''
Set the shade of gray to be used for filling solid objects
to N; N must be an integer between 0 and 1000, where 0
corresponds solid white and 1000 to solid black, and values
in between correspond to intermediate shades of gray. This
applies only to solid circles, solid ellipses and solid
polygons. By default, a level of 1000 is used.
`\D'p DX1 DY1 DX2 DY2 ...''
Draw a polygon from the current location to (DX1,DY1) and
then to (DX2,DY2) and so on. When the specified data points
are exhausted, a line is drawn back to the starting point.
`\D'P DX1 DY1 DX2 DY2 ...''
Draw a solid polygon with the same parameters as an outlined
polygon.
`\D't N''
Set the current line thickness to N machine units. A value of
zero selects the smallest available line thickness. A
negative value makes the line thickness proportional to the
current point size (this is the default behaviour of
`ditroff').
- Escape: \b'STRING'
"Piles" a sequence of characters vertically, and centers it
vertically on the current line. Use it to build large brackets
and braces.
\b'\(lt\(bv\(lk\(bv\(lb'
Note:Drawing Functions.