A bare expression,
expr, is acceptable as an attribute; it is equivalent to
dir expr, where
dir is the current direction. For example
line 2i
means draw a line 2 inches long in the current direction. The `i' (or `I') character is ignored; to use another measurement unit, set the scale variable to an appropriate value.
The maximum width and height of the picture are taken from the variables maxpswid and maxpsht. Initially these have values 8.5 and 11.
Scientific notation is allowed for numbers. For example
Text attributes can be compounded. For example,
is valid.
There is no limit to the depth to which blocks can be examined. For example,
[A: [B: [C: box ]]] with .A.B.C.sw at 1,2
circle at last [].A.B.C
is acceptable.
Arcs now have compass points determined by the circle of which the arc is a part.
Circles, ellipses, and arcs can be dotted or dashed. In TeX mode splines can be dotted or dashed also.
Boxes can have rounded corners. The rad attribute specifies the radius of the quarter-circles at each corner. If no rad or diam attribute is given, a radius of boxrad is used. Initially, boxrad has a value of 0. A box with rounded corners can be dotted or dashed.
The .PS line can have a second argument specifying a maximum height for the picture. If the width of zero is specified the width will be ignored in computing the scaling factor for the picture. Note that GNU pic will always scale a picture by the same amount vertically as well as horizontally. This is different from the DWB 2.0 pic which may scale a picture by a different amount vertically than horizontally if a height is specified.
Each text object has an invisible box associated with it. The compass points of a text object are determined by this box. The implicit motion associated with the object is also determined by this box. The dimensions of this box are taken from the width and height attributes; if the width attribute is not supplied then the width will be taken to be textwid; if the height attribute is not supplied then the height will be taken to be the number of text strings associated with the object times textht. Initially textwid and textht have a value of 0.
In (almost all) places where a quoted text string can be used, an expression of the form
sprintf(ςformatς, arg,...)
can also be used; this will produce the arguments formatted according to format, which should be a string as described in printf(3) appropriate for the number of arguments supplied.
The thickness of the lines used to draw objects is controlled by the linethick variable. This gives the thickness of lines in points. A negative value means use the default thickness: in TeX output mode, this means use a thickness of 8 milliinches; in TeX output mode with the -c option, this means use the line thickness specified by .ps lines; in troff output mode, this means use a thickness proportional to the pointsize. A zero value means draw the thinnest possible line supported by the output device. Initially it has a value of -1. There is also a thick[ness] attribute. For example,
would draw a circle using a line with a thickness of 1.5 points. The thickness of lines is not affected by the value of the scale variable, nor by the width or height given in the .PS line.
Boxes (including boxes with rounded corners), circles and ellipses can be filled by giving them an attribute of fill[ed]. This takes an optional argument of an expression with a value between 0 and 1; 0 will fill it with white, 1 with black, values in between with a proportionally gray shade. A value greater than 1 can also be used: this means fill with the shade of gray that is currently being used for text and lines. Normally this will be black, but output devices may provide a mechanism for changing this. Without an argument, then the value of the variable fillval will be used. Initially this has a value of 0.5. The invisible attribute does not affect the filling of objects. Any text associated with a filled object will be added after the object has been filled, so that the text will not be obscured by the filling.
Three additional modifiers are available to specify colored objects: outline[d] sets the color of the outline, shaded the fill color, and colo[u]r[ed] sets both. All three keywords expect a suffix specifying the color, for example
circle shaded ""green"" outline ""black""
Currently, color support isn't available in TeX mode. Predefined color names for groff are in the device macro files, for example ps.tmac; additional colors can be defined with the .defcolor request (see the manual page of troff(1) for more details).
To change the name of the vbox in TeX mode, set the pseudo-variable figname (which is actually a specially parsed command) within a picture. Example:
.PS
figname = foobar;
...
.PE
The picture is then available in the box \foobar.
pic assumes that at the beginning of a picture both glyph and fill color are set to the default value.
Arrow heads will be drawn as solid triangles if the variable arrowhead is non-zero and either TeX mode is enabled or the -n option has not been given. Initially arrowhead has a value of 1. Note that solid arrow heads are always filled with the current outline color.
The troff output of pic is device-independent. The -T option is therefore redundant. All numbers are taken to be in inches; numbers are never interpreted to be in troff machine units.
Objects can have an aligned attribute. This will only work if the postprocessor is grops. Any text associated with an object having the aligned attribute will be rotated about the center of the object so that it is aligned in the direction from the start point to the end point of the object. Note that this attribute will have no effect for objects whose start and end points are coincident.
In places where nth is allowed `expr'th is also allowed. Note that 'th is a single token: no space is allowed between the ' and the th. For example,
for i = 1 to 4 do {
line from `i'th box.nw to `i+1'th box.se
}