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

1 thought on “Hello World!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s