Next: , Previous: Simple Commands, Up: Command Reference


8.1.2.3 Graphics Commands

Each graphics or drawing command in the intermediate output starts with the letter ‘D’, followed by one or two characters that specify a subcommand; this is followed by a fixed or variable number of integer arguments that are separated by a single space character. A ‘D’ command may not be followed by another command on the same line (apart from a comment), so each ‘D’ command is terminated by a syntactical line break.

gtroff output follows the classical spacing rules (no space between command and subcommand, all arguments are preceded by a single space character), but the parser allows optional space between the command letters and makes the space before the first argument optional. As usual, each space can be any sequence of tab and space characters.

Some graphics commands can take a variable number of arguments. In this case, they are integers representing a size measured in basic units ‘u’. The arguments called h1, h2, ..., hn stand for horizontal distances where positive means right, negative left. The arguments called v1, v2, ..., vn stand for vertical distances where positive means down, negative up. All these distances are offsets relative to the current location.

Each graphics command directly corresponds to a similar gtroff \D escape sequence. See Drawing Requests.

Unknown ‘D’ commands are assumed to be device-specific. Its arguments are parsed as strings; the whole information is then sent to the postprocessor.

In the following command reference, the syntax element <line break> means a syntactical line break as defined above.

D~ h1 v1 h2 v2 ... hn vn<line break>
Draw B-spline from current position to offset (h1,v1), then to offset (h2,v2), if given, etc. up to (hn,vn). This command takes a variable number of argument pairs; the current position is moved to the terminal point of the drawn curve.
Da h1 v1 h2 v2<line break>
Draw arc from current position to (h1,v1)+(h2,v2) with center at (h1,v1); then move the current position to the final point of the arc.
DC d<line break>
DC d dummy-arg<line break>
Draw a solid circle using the current fill color with diameter d (integer in basic units ‘u’) with leftmost point at the current position; then move the current position to the rightmost point of the circle. An optional second integer argument is ignored (this allows the formatter to generate an even number of arguments). This command is a gtroff extension.
Dc d<line break>
Draw circle line with diameter d (integer in basic units ‘u’) with leftmost point at the current position; then move the current position to the rightmost point of the circle.
DE h v<line break>
Draw a solid ellipse in the current fill color with a horizontal diameter of h and a vertical diameter of v (both integers in basic units ‘u’) with the leftmost point at the current position; then move to the rightmost point of the ellipse. This command is a gtroff extension.
De h v<line break>
Draw an outlined ellipse with a horizontal diameter of h and a vertical diameter of v (both integers in basic units ‘u’) with the leftmost point at current position; then move to the rightmost point of the ellipse.
DF color-scheme [component ...]<line break>
Set fill color for solid drawing objects using different color schemes; the analoguous command for setting the color of text, line graphics, and the outline of graphic objects is ‘m’. The color components are specified as integer arguments between 0 and 65536. The number of color components and their meaning vary for the different color schemes. These commands are generated by gtroff's escape sequences \D'F ...' and \M (with no other corresponding graphics commands). No position changing. This command is a gtroff extension.
DFc cyan magenta yellow<line break>
Set fill color for solid drawing objects using the CMY color scheme, having the 3 color components cyan, magenta, and yellow.
DFd<line break>
Set fill color for solid drawing objects to the default fill color value (black in most cases). No component arguments.
DFg gray<line break>
Set fill color for solid drawing objects to the shade of gray given by the argument, an integer between 0 (black) and 65536 (white).
DFk cyan magenta yellow black<line break>
Set fill color for solid drawing objects using the CMYK color scheme, having the 4 color components cyan, magenta, yellow, and black.
DFr red green blue<line break>
Set fill color for solid drawing objects using the RGB color scheme, having the 3 color components red, green, and blue.

Df n<line break>
The argument n must be an integer in the range -32767 to 32767.
0 <= n <= 1000
Set the color for filling solid drawing objects to a shade of gray, where 0 corresponds to solid white, 1000 (the default) to solid black, and values in between to intermediate shades of gray; this is obsoleted by command ‘DFg’.
n < 0 or n > 1000
Set the filling color to the color that is currently being used for the text and the outline, see command ‘m’. For example, the command sequence
               
               mg 0 0 65536
               Df -1

sets all colors to blue.

No position changing. This command is a gtroff extension.

Dl h v<line break>
Draw line from current position to offset (h,v) (integers in basic units ‘u’); then set current position to the end of the drawn line.
Dp h1 v1 h2 v2 ... hn vn<line break>
Draw a polygon line from current position to offset (h1,v1), from there to offset (h2,v2), etc. up to offset (hn,vn), and from there back to the starting position. For historical reasons, the position is changed by adding the sum of all arguments with odd index to the actual horizontal position and the even ones to the vertical position. Although this doesn't make sense it is kept for compatibility. This command is a gtroff extension.
Dp h1 v1 h2 v2 ... hn vn<line break>
Draw a solid polygon in the current fill color rather than an outlined polygon, using the same arguments and positioning as the corresponding ‘Dp’ command. This command is a gtroff extension.
Dt n<line break>
Set the current line thickness to n (an integer in basic units ‘u’) if n>0; if n=0 select the smallest available line thickness; if n<0 set the line thickness proportional to the point size (this is the default before the first ‘Dt’ command was specified). For historical reasons, the horizontal position is changed by adding the argument to the actual horizontal position, while the vertical position is not changed. Although this doesn't make sense it is kept for compatibility. This command is a gtroff extension.