
A stroke is the line around an object. You can give an object's stroke a different color than its fill. You also have several options when it comes to strokes, which actually makes for some very interesting and useful implementations, which we cover later in this hour. Throughout this hour, we will learn about:
The Stroke palette (F10) can be set to either show only the stroke weight or all of the stroke attributes including Miter Limit, Line Caps and Joins, and Dashed Lines. You can choose either setting by selecting Show Options from the palette menu (see Figure 11.1).
Viewing the entire Stroke palette.
The most used option in the Stroke palette is the stroke weight. This is what determines how thick or thin the stroke is. Illustrator's default is 1 point. For hairline rules, most people use .25 point. You can enter any amount from 0 to 1000 points, and you can even enter numbers in different measurements (such as 2.5 in.) and Illustrator converts it to points for you.
CAUTION: In Illustrator, if you enter a weight of zero points, it prints the stroke as a PostScript Hairline, which is defined as the smallest line width possible on your printing device. This means if you are printing to a 300 dpi laser printer, your "0" point stroke prints at 1/300 of an inch. Print that same "0" point stroke on a high-end 3386 dpi imagesetter and you get a stroke of 1/3386 of an inch, which is barely discernible, even using a 10 x loupe. My advice is to avoid using "0" point, and when you want a hairline, use .25 point. You'll be happy you did.
The Miter Limit determines how far the stroke sticks out on a sharp point. A thick line, for example, needs more room to complete a sharp point than a thin one does (see Figure 11.2).
From the left, a 2 point stroke with a miter limit of 2, a 20 point stroke with a miter limit of 2, and a 20 point stroke with a miter limit of 4.
Line caps determine the ends of a stroked path. This setting is only used for open-ended paths. By choosing different caps, you can make the ends either flat, rounded, or have the stroke width enclose the end of the path as well (see Figure 11.3).
The three types of line caps. Notice how the bottom two actually protrude one-half the stroke weight from the actual anchor point.
Line joins control how the stroke appears at each anchor point on the path. You can choose Mitered, Round, or Beveled joins (see Figure 11.4).
A star with (from left) mitered, round, and beveled joins.
The last option in the Stroke palette can be one of the most powerful. Here you can specify dashed or dotted lines. Depending on what settings you have set for weight, line caps, and joins, you can create a stitched line, a skip line, or almost anything. You control the dash and gap (the space between each dash) by entering numbers into the Dash and Gap fields at the bottom of the palette. If you're just using one sequence, you can enter just the first two fields. Or you can enter up to three different Dash and Gap settings to achieve complex dash patterns (see Figure 11.5).
A variety of strokes with different Dash and Gap settings. The last stroke uses round caps to achieve the dotted line effect.
Using strokes with different settings, and layering them on top of each other, you can achieve some interesting results. How interesting, you ask? Well, how about railroad tracks? or maybe a nice highway? With some imagination and forethought, you can apply the power of strokes to more and more functions. The possibilities are endless!
Start with a nice curved line.
I've been workin' on the railroad...
4. Give this path a fill of None and a stroke of white.
5. Change the stroke weight to 14 points. You should now see a double line (see Figure 11.8). Because the white line is narrower, you see 3 points of the bottom line on either side (20 minus 14).
In reality, what you're seeing is a white line blocking out the middle of a thicker black stroke.
7. Give the path a fill of None, and a stroke of black.
8. Change the weight to 26 points, and give the stroke a dash of 2 points and a gap of 10 points (see Figure 11.9).
The completed train tracks.
Look at that! We created train tracks from just three paths. Even more amazing, switch to artwork mode (Command-Y)[Control-Y] and what do you see? Only one thin line.
Think that's cool? Well, my good friend Ted Alspach of Illustrator fame put together something even cooler: an eight lane freeway, made up entirely of strokes.

2. Change the paint style (Fill=none; Stroke=300 pt., C=100, M=10, Y=90, K=18). This path is the grass border of the highway.

3. Copy (Command-C)[Control-C] and Paste in Front (Command-F)[Control-F]. Change the paint style (Stroke=240 pt., K=80). This is the dark asphalt edge of the highway.

4. Paste in Front (Command-F)[Control-F]. Change the paint style (Stroke=165 pt., white). This is the white line along the outside edge of the highway.

5. Paste in Front (Command-F)[Control-F]. Change the paint style (Stroke=160 pt., K=40). This path is the main road.

6. Paste in Front (Command-F)[Control-F]. Change the paint style (Stroke=85 pt., white, dash=12, gap=20). Though it doesn't look like it right now, these are the dashed lines.

7. Paste in Front (Command-F)[Control-F]. Change the paint style (Stroke=80 pt., K=40). This is the passing lane.

8. Paste in Front (Command-F)[Control-F]. Change the paint style (Stroke=8 pt., M=10, Y=100). This is the double yellow line.

9. Paste in Front (Command-F)[Control-F]. Change the paint style (Stroke=3 pt., K=40). This path is used to separate the double yellow lines.
Shown here are two variations on the highway theme. The first is a two lane highway, while the second is an intricate eight lane freeway.

For outlining and special effects, Offset Path is a great function. Offset Path
creates an object that perfectly outlines, or traces, a selected path at an offset
that you specify. To use it, select one or more objects and choose Object
Path
Offset Path (see Figure 11.10) and
the Offset Path dialog box appears (see Figure 11.11). Enter an amount to offset
(you can use positive or negative numbers), and click OK. Note that Offset Path always
makes a copy of your selection, and does not affect the original (see Figure 11.12).
Choosing Offset Path from the Object menu.
You can select one of three join options: round, bevel, and miter.
The results of using Offset Path.
Time Saver: You may notice that the Offset Path command may produce what looks like extra lines in each object (refer to Figure 11.12). To "clean up" these lines choose ObjectPathfinder
Unite. It's best to run this function right after you use Offset Path because your selection is still active. (More on the Unite and Pathfinder commands in Hour 13, "The Pathfinder Commands.")
Outline Path is another great feature that converts strokes into filled objects (see Figure 11.13). Found in the same location as the Offset Path command, the Outline Path works by taking the stroke width and creating a filled shape the size of the width (see Figure 11.14). This can be a real timesaver in a production environment, as well as enable workarounds such as filling an outlined stroke with a gradient (a gradient cannot be applied to a stroke).
On the left, a stroked path. On the right, the path converted to an outline.
With the same images viewed in Artwork mode, you can see how the stroke has been outlined.
Unfortunately, Outline Path does not use dash information when converting a path to an outline. When used, the path (actually the object) becomes solid.
Before things even got started, we learned that strokes are a good thing (at least in Illustrator they are). We learned all about stroke weight, and how different joins and caps can make a stroke appear very different. After we covered dashed patterns, we even made an entire illustration out of nothing but strokes!
Stroke weight--The thickness of a line (path).
Miter--The extrusion of the stroke weight at a sharp change in direction.
Cap--The stroke attribute used at the endpoints of a stroke.
Dash--The part of a stroke that is visible.
Gap--The part of a stroke that is transparent.
Stitched Line--A steady dashed line, giving the appearance of a sewn stitch.
Skip Line--A dashed line in which the dash and gap are not consistent.
© Copyright, Macmillan Computer Publishing. All rights reserved.