[comp.lang.postscript] See-thru fills

dudkl@dcatla.UUCP (Danny K. Llewallyn) (05/19/89)

Please don't ask me why, but I have been playing around with the idea
of a fill operator that does not coverup what has already been placed
onto the page.  The only way that this can be accomplished  (please
chime in Glenn) is via the imagemask operator.  This small program
illustrates what I am trying to do.  Is anyone else out there trying
to do this kindof thing?

----------------------------- cut here ------------------------------
200 200 translate
/Helvetica-Bold findfont 32 scalefont setfont
-30 100 moveto
(Graphics or Text)show
244 244 scale
/i false def
72 72 true [72 0 0 -72 0 72]
{
  i
  {/i false def <555555555555555555>}
  {/i true def  <AAAAAAAAAAAAAAAAAA>}
  ifelse
}imagemask
showpage
-- 
-------------------------------------------------------------------------------
                          .signature files suck
-------------------------------------------------------------------------------

greid@adobe.com (Glenn Reid) (05/20/89)

In article <19073@dcatla.UUCP> dudkl@dcatla.UUCP (Danny K. Llewallyn) writes:
>Please don't ask me why, but I have been playing around with the idea
>of a fill operator that does not coverup what has already been placed
>onto the page.  The only way that this can be accomplished  (please
>chime in Glenn) is via the imagemask operator.  This small program
>illustrates what I am trying to do.  Is anyone else out there trying
>to do this kindof thing?

There is another way to do it.  The "patternfill" example in the Green
Book (see page 137) uses font characters inside a clipping region to do
pattern filling.  The font characters draw an outline and fill it, and
it does not write any of the `white' bits.  Also, you get to take
advantage of the font cache if you use font characters for your
patterns.

Imagemask will do it, too, but you're stuck at one effective resolution
for the bitmap, and it probably takes longer to image all the data than
to use the font cache.  You also will need to use "clip" to fill
arbitrary shapes.

Check it out in the Green Book.  If you want to play with the code, you
can retrieve it from our file server by sending a message to
"ps-file-server@adobe.COM" containing the line
"send Programs greenbook.shar" in the body or in the Subject: line.
It's a UNIX shell archive with all of the Green Book programs in it.

Glenn Reid
Adobe Systems