Previous Next
218
CHAPTER 4 Graphics
the dash pattern at which to start the dash. The elements of both the dash array
and the dash phase are expressed in user space units.
Before beginning to stroke a path, the dash array is cycled through, adding up the
lengths of dashes and gaps. When the accumulated length equals the value speci-
fied by the dash phase, stroking of the path begins, and the dash array is used cy-
clically from that point onward. Table 4.6 shows examples of line dash patterns.
As can be seen from the table, an empty dash array and zero phase can be used to
restore the dash pattern to a solid line.
TABLE 4.6 Examples of line dash patterns
DASH ARRAY APPEARANCE DESCRIPTION
AND PHASE
[] 0 No dash; solid, unbroken lines
[3] 0 3 units on, 3 units off, …
[2] 1 1 on, 2 off, 2 on, 2 off, …
[2 1] 0 2 on, 1 off, 2 on, 1 off, …
[3 5] 6 2 off, 3 on, 5 off, 3 on, 5 off, …
[ 2 3 ] 11 1 on, 3 off, 2 on, 3 off, 2 on, …
Dashed lines wrap around curves and corners just as solid stroked lines do. The
ends of each dash are treated with the current line cap style, and corners within
dashes are treated with the current line join style. A stroking operation takes no
measures to coordinate the dash pattern with features of the path; it simply dis-
penses dashes and gaps along the path in the pattern defined by the dash array.
When a path consisting of several subpaths is stroked, each subpath is treated in-
dependently—that is, the dash pattern is restarted and the dash phase is reapplied
to it at the beginning of each subpath.
4.3.3 Graphics State Operators
Table 4.7 shows the operators that set the values of parameters in the graphics
state. (See also the color operators listed in Table 4.24 and the text state operators
in Table 5.2 on page 398.)
Previous Next