Previous Next
216
CHAPTER 4 Graphics
Line Cap Style
The line cap style specifies the shape to be used at the ends of open subpaths (and
dashes, if any) when they are stroked. Table 4.4 shows the possible values.
TABLE 4.4 Line cap styles
STYLE APPEARANCE DESCRIPTION
0 Butt cap. The stroke is squared off at the endpoint of the path. There is no
projection beyond the end of the path.
1 Round cap. A semicircular arc with a diameter equal to the line width is
drawn around the endpoint and filled in.
2 Projecting square cap. The stroke continues beyond the endpoint of the path
for a distance equal to half the line width and is squared off.
Line Join Style
The line join style specifies the shape to be used at the corners of paths that are
stroked. Table 4.5 shows the possible values. Join styles are significant only at
points where consecutive segments of a path connect at an angle; segments that
meet or intersect fortuitously receive no special treatment.
TABLE 4.5 Line join styles
STYLE APPEARANCE DESCRIPTION
0 Miter join. The outer edges of the strokes for the two segments are extended
until they meet at an angle, as in a picture frame. If the segments meet at too
sharp an angle (as defined by the miter limit parameter—see “Miter Limit,”
above), a bevel join is used instead.
1 Round join. An arc of a circle with a diameter equal to the line width is drawn
around the point where the two segments meet, connecting the outer edges of
the strokes for the two segments. This pieslice-shaped figure is filled in, pro-
ducing a rounded corner.
2 Bevel join. The two segments are finished with butt caps (see “Line Cap Style”
on page 216) and the resulting notch beyond the ends of the segments is filled
with a triangle.
Previous Next