Textbook exercices

Today, we test the exercices of the excellent book Understanding PostScript programming by David A. Holzgang which made me learn PostScript for the first time in the eighties. All exercices work on a page A4 (595 * 842 pixel)

Page 33.

Javascript Editor

Page 52.

Javascript Editor

Page 82. For the parser: a number can also start with a period.

Javascript Editor

Page 123. Here rpnCanvasDevice, rpnSVGDevice and rpnPDFDevice closed the stroke path automatically. Also, the size of the PDF was not adapted.

Javascript Editor

Page 125.

Javascript Editor

Page 129.

Javascript Editor

Page 136.

Javascript Editor

Page 140.

Javascript Editor

Page 142.

Javascript Editor

Page 154. For this exercise, we need to add an arc operator do draw circles. There is an arc operator that draws arcs segments from the center and then there is the arcto operator that draws arcs that integrate in paths. Anyway we will simulate the arc with Bezier.

Javascript Editor

Javascript Editor

Page 157

Javascript Editor

For the the next exercise we need the operator arcto that is used for rounded rectangles.

Javascript Editor

Page 163

Javascript Editor

Page 170

Javascript Editor

Page 173

Javascript Editor

Page 175

Javascript Editor

Page 181

Javascript Editor

For the next exercice, we need the count operator that returns the stack count.

Javascript Editor

Page 218

Javascript Editor

ps20241115.js 3587 lines, 129 KB.

My Journey to PostScript