Hello World!

There is an application, comes with Mac OS X, called Preview that
interprets postscript code. With it, you can open a text file containing code like this:

%!PS
/fontSize 12 def
/charRow 16 string def % BUFFER
/Symbol fontSize selectfont
20 770 translate
0 0 moveto
0 1 15 {
    /y exch 16 mul def
    0 1 15 {
        charRow exch dup y add put
        } for
    gsave charRow show grestore
    0 fontSize neg rmoveto
    } for
showpage

and Preview will automatically interpret the code and give you the image.

The above code generates a page showing all the Symbol font characters:

Symbol character set

The Preview application is an interpreter, albeit not a full-featured interpreter like Distiller, but it’s very useful for running simple postscript programs.

Advertisement