May 3, 1998

PostScript Fill Effects

Here are a few examples of how to use the PostScript Fill effects in FreeHand. This is in conjunction with the PostScript Line Effects in the Tip Archive. To find more information about programming in PostScript, check out those Real World FreeHand books from Olav Martin Kvern and the PostScript Language Reference Manual from Adobe.

I won't go into total detail of how these work and what some of the elements in the code do, as you can find more about this in the above books. There will be a couple with adjustable variables that I'll walk you through in order to get the effect you want.

Version: 3 and above

 
 

Ever wonder how to use the PostScript option in the Fill Inspector? Well I'm going to give you a few great examples of how to create custom PostScript Fills.

Although the scripts themselves may look greek to you and me, they tell FreeHand™ how to draw different types of fill effects.

Below are two examples of how powerful PostScript line effects can be.


WARNING

When entering the following PostScript codes into the Inspector, do NOT press the Return key to drop to the next line. Just let the code wrap naturally in the code area. After entering the code just press the Enter key to apply the code to your closed object. You can however, use spaces between each element of the code. To get these codes easily without retyping them, you can copy and paste the text from this page to FreeHand™.

Also, you will not see the effect applied to the object in FreeHand™ itself, instead you'll see a pattern with "ps" as the fill. You can test your effects by printing to a PostScript compatible printer. If you don't have a PostScript printer, you can also export your art as an EPS file and open it in PhotoShop to view the final results (That is what I've done to show you the examples below).

If you do not see any effects with the fills using the above methods, or if you get PostScript errors when printing or opening in PhotoShop, then there is something wrong with how you entered the code. Make sure you enter it exactly as below.

Splatter Effect

Enter this code:

1 srand clipper pathbbox 4 copy pop pop translate 3 -1 roll sub cvi 3 1 roll exch sub cvi newpath 100 {2 copy rand exch mod exch rand exch mod 2 copy moveto rand 5 mod 1 add 0 369 arc F} repeat

As you can see in the examples above, this script creates a splattering type of effect in your closed object. Once applied to an object, you can create a style in the Style palette, so you don't lose the code in case you delete the object later. Once you apply this effect to an object, you are free to change it's line weight and fill color. This fill is also transparent as you can see in the second example above. Just clone the shape, place it behind the original object, and fill it with a Basic color.

The element "1 srand" in the first line makes sure that when you print this effect, it's the same every time. You can change the number to any number above zero to change the randomness of the effect. You can also remove this element all together, which will cause it to change every time you print (not a good idea if you plan to make color separations).

The number after "newpath 100" is used to control how many splotches are generated in the fill. For bigger shapes, it's a good idea to bump this number up. Of course, the bigger the number, the longer it will take to print.

The numbers near the end of the code "rand 5 mod 1 add" are the maximum and minimum sizes of the splotches respectively. These are measured in points and control the radius of the splotches, so enter a value for half the diameter you want to use.


Gradient Bars

Enter this code:

clipper 5 setlinewidth 5 dict begin pathbbox /T exch def /R exch def 2 copy translate /B exch def /L exch def /W R L sub def /T T B sub def newpath 0 W 20 div W {W div 9 mul 1 add log W mul T moveto 0 T neg rlineto} for S end

As you can see in the examples above, this script creates a series of vertical lines that mimics a gradient line type of effect in your closed object. Once applied to an object, you can create a style in the Style palette, so you don't lose the code in case you delete the object later. Once you apply this effect to an object, you are free to change it's line weight and fill color. This fill is also transparent as you can see in the second example above. Just clone the shape, place it behind the original object, and fill it with a Basic color.

The number at the beginning, after "clipper 5", is the width of the vertical lines in points.

The number in the element "W 20 div W" controls the number of vertical lines drawn across the width of the object.

The number near the end, in the element "moveto 0", controls the angle of the gradient lines. This can be 0-360, do NOT use negative numbers. A helpful way of determing what angle you want is to create a shape somewhere with a gradient fill and play with the angle dial. When you get an angle you like, replace the 0 with that value.


Now for something completely different, you can use a combination of the PostScript Line Effects in the Tip Archive, with these effects. Here I used the Earthquake Line effect. You can really go nuts with these effects, but don't over do it. The key to great design, is getting the message across without a lot of flashy stuff that distracts from the message.

PostScript editing is not for the faint of heart and one typo in the code above won't harm your art, it just won't work. These are just a few examples of how it can really make your life easier if your looking for quick effects. If anyone has any others they'd like to add, please feel free to send them to me via the Feedback page under the Misc. Tab.