[comp.lang.postscript] Forms/Patterns and PostScript Level 2

orthlieb@adobe.COM (Carl Orthlieb) (08/15/90)

David Gelphman pointed this article out to me and had some informative
things to say about forms and patterns under PostScript Level 2.

In article <154@xurilka.UUCP> writes:
>
>I have digested whatever snippets of level II information
>that exist. There is a decent mention in the August Byte
>but Adobe sends out a press kit that is rather informative.
>
>what I find ironic is the addition of a *form*. 
>A programmer can design a form comprimised of the usual
>PostScript graphics, but now the bitmap is kept around and
>on the subsequent uses of the form, instead of rendering
>the postscript code, the bitmap is copied. 
>Which means that if your print job has something
>in common across all the pages, PostScript
>only has to sweat once, the rest it copies the bitmap.
>
>This is a valuable addition since many people have run
>into the situation where having a forms feature would
>speed up printing. 
>However, I find it ironic that , PostScript, a language 
>for device independance, now has commands which control
>and imply bitmaps.  (There is a similar additional feature 
>known as a *pattern* which lets the user define a pattern tile). 
>Patterns are even cached.  
>
    There is a slight misconception here as to the way that forms and
patterns actually work. In PostScript Level 2, a form is a PostScript 
dictionary which follows certain guidelines (similar to those for fonts).
One of the keys in the form dictionary is a PaintProc procedure which is 
responsible for imaging the form. When the form is first imaged (with
the execform operator) the PaintProc procedure will be called to image the
form. Depending on the amount of available memory, the results of
executing the PaintProc may also be cached. The actual type of data which
is cached may depend on the resolution of the output device and other factors.
In any case, the cache is not necessarily a bitmap representation of the form
and it is not possible to manipulate the cached representation (just as
it is not possible to manipulate the cached representation of a font). One
significant difference between a form and a font is that a form may contain
color information and still be cached. Indeed calling this mechanism a 'form'
is perhaps misleading because it is potentially useful for more than the
standard notion of forms.
    Patterns work in a somewhat similar manner to forms in terms of caching
but are used in a completely different manner. Patterns are used as paint
to fill and/or stroke paths, painting characters, or bit images which are
used as masks. As with forms, patterns can contain arbitrary PostScript
graphics except there are some restrictions on using patterns within patterns.
    One critical design point is that regardless of whether the imaging of a
character, a pattern, or form is from a cache or not, the results should
be identical. The only difference is a performance win when the
cache is used.

David G.