manpagez: man pages & more
info groff
Home | html | info | man

File: groff.info,  Node: Graphics Commands,  Next: Device Control Commands,  Prev: Simple Commands,  Up: Command Reference

6.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.  *Note Drawing Geometric Objects::.

   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 
means a syntactical line break as defined above.

'D~ H1 V1 H2 V2 ... HN VN'
     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'
     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'
'DC D DUMMY-ARG'
     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'
     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'
     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'
     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 ...]'
     Set fill color for solid drawing objects using different color
     schemes; the analogous 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 65535.
     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'
          Set fill color for solid drawing objects using the CMY color
          scheme, having the 3 color components CYAN, MAGENTA, and
          YELLOW.

     'DFd'
          Set fill color for solid drawing objects to the default fill
          color value (black in most cases).  No component arguments.

     'DFg GRAY'
          Set fill color for solid drawing objects to the shade of gray
          given by the argument, an integer between 0 (black) and 65535
          (white).

     'DFk CYAN MAGENTA YELLOW BLACK'
          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'
          Set fill color for solid drawing objects using the RGB color
          scheme, having the 3 color components RED, GREEN, and BLUE.

'Df N'
     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 65535
               Df -1

          sets all colors to blue.

     No position changing.  This command is a 'gtroff' extension.

'Dl H V'
     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'
     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'
     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'
     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 type 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.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.