PostScript

From XPUB & Lens-Based wiki

PostScript, or in short: ps

launched in 1984 by Adobe

page description language and programming language

reading between the ps lines

Postscript-examples-01.png Postscript-examples-02.png Postscript-examples-03.png Postscript-examples-04.png Postscript-examples-05.png Postscript-examples-06.png

PostScript in context

PostScript had a huge impact on the printing industry and printing practices, there is almost no way to print without crossing with ps/pdf...

PostScript aimed to be "the" universal standard, as a business strategy and preferred way of working...

PostScript starting from geometry as main framework for aesthetics.

Not: engineering approach (no need to really learn to write PostScript), more: an exploratory approach (what role did/does it play).

Reading examples and documentation:

PostScript as research

  • media archeological approach: what has the role of PostScript been? What happened in 1984?
  • In what degree can we still use PostScript these days? What does that mean?
  • What aesthetics does PostScript create?
  • How does PostScript allow us to think of graphics and layout?
  • Can we still send .ps files directly to the printer? What does that mean?
  • How are businesses entangled with printing practices, even the very arty and crafty ones?

Examples of artistic usage of PostScript:

  • Jian Haake (XPUB 2023) used PostScript in her project Modular Matter to generate the prints
  • ...

writing Postscript

You can write your PostScript code in your code editor.

Save the file with the .ps extension.

Then, to see it, turn it into a PDF with $ ps2pdf:

$ ps2pdf myfile.ps

this will generate the file: myfile.pdf

Method: versioning examples, start from an example and work from there.

TIP: if you see an example in one of the BOOKS that you like, print it out!

First: playing with boxes

Use the code below to draw a box on a page, play with drawing multiple boxes on the same page, rotate them, give them colors, use different sizes, etc.

box

BLUEBOOK, chapter 3, page 20

newpath
200 10 moveto        % x y
0 72 rlineto
72 0 rlineto
0 -72 rlineto
-72 0 rlineto
closepath
4 setlinewidth
stroke

showpage

Instead of stroke you can also use fill.

You can rotate the box with 60 rotate, where 60 = degrees.

And you can draw another box positioned relatively to the current box with: 300 150 translate (see BLUEBOOK page 49).

color

If you want to use color, you can try one of the following color systems:

255 255 255 setrgbcolor
100 100 100 100 setcmykcolor
.75 setgray

Then: add some text

Add text to your page that says something about PostScript. It can be anything!

Maybe you heard something funny in the video we watched, or maybe you read a weird sentence in one of the books, or a strange expression. You can also give your opinion: how does it feel to work with an media archetype from the 1980s? What stood out for you? What do you read between PostScript's lines?

You can add text with the the following lines of code below.

text

/Times-Roman findfont 30 scalefont setfont
100 100 moveto
(My text) show

showpage

fonts

See BLUEBOOK, chapter 5, page 40

The standard PostScript typefaces:

Times-Roman 
Times-Bold 
Times-Italic 
Times-BoldItalic 
Helvetica 
Helvetica-Bold 
Helvetica-Oblique 
Helvetica-BoldOblique 
Courier 
Courier-Bold 
Courier-Oblique 
Courier-BoldOblique

Then: try more examples

There are more examples in the BLUEBOOK:

  • lines on page 18
  • circles/curves on page 53
  • stars on page 51
  • text shadows on page 68
  • fractals/recursive graphics on page 74
  • CircleofAdobe on page 98
  • a rosette on page 133
  • squares in squares on page 135
  • elliptical arcs on page 137
  • arrows on page 141
  • vertical text on page 165
  • circular text on page 167
  • text on arbitrary paths on page 171
  • patterns on page 191
  • type in type clipping paths on page 104


And in this tutorial PDF from the UvA i found:

  • confetti on page 75
  • tree using recursing on page 78

End of the day

Let's collect all PDFs at cerealbox: /var/www/html/SI26/postscript/

PostScript on Mac/Windows

Mac

Not tested, but there seem to be a few options:

  • $ ps2pdf, if not installed you could install it by installing ghostscript through homebrew: $ brew install ghostscript (you might need to run it with $ ps2pdf -dEPSCrop in case you get weird white space issues)
  • open a .ps file in Adobe Acrobat
  • PostScriptToPDF
  • $ inkscape -o myfile.pdf --export-type=pdf -T myfile.ps (the -T is converting text to path.)
  • open a .ps file in Preview (dropped since MacOS Ventura?)
  • $ pstopdf (dropped since MacOS Sonoma?)

Windows

/!\ For some reason, ps2pdf might not be recognized. If that is the case, you can run it from WSL: https://learn.microsoft.com/en-us/windows/wsl/setup/environment

See also