CS 3723/3721 Programming Languages
Postscript Basics


Postscript:

Basic Topics (from the Blue Book):

  1. Three types of graphics objects:
    1. Text: characters in many fonts, positioned and oriented in any way.
    2. Geometric figures: Drawn using powerful 2-dimensional graphics operators, using lines, curves, filled regions, color.
    3. Images: anything that can be digitized.
    (See Blue Book, pages 1-2.)
  2. The imaging model:
    1. Current page: can place anything anywhere, overwriting old stuff
    2. Current path: a set of connected lines and curves making a path, often closed.
    3. Current clipping path: a closed path within which all drawing occurs.
    (See Blue Book, pages 2-3.)
  3. Initial graphics: (See Blue Book, pages 3-4.)
  4. The Stack: used for all computations and operators. Postfix notation. (See Blue Book, page 4, 7-15.)
  5. Coordinate systems: x (horizontal) and y (vertical) coordinates, with (0, 0) in the lower left corner. Units are Postscipt points, where 1 point = 1/72 inch (in actual publishing, 1 point = 1/72.27 inch.) (See Blue Book, Chapter 3, pages 17-25.)
  6. Variables and procedures: (It's getting harder now.) (See Blue Book, Chapter 4, pages 27-33.)
  7. Text: (See Blue Book, Chapter 5, pages 35-46.)
  8. More graphics: (See Blue Book, Chapter 6, pages 47-60.)
  9. Conditionals and for loops: (See Blue Book, Section 7.1 and first page of 7.2, pages 61-68.)
  10. Outline fonts: (See Blue Book, Section 9.4, pages 97-99.)
  11. Clipping: (See Blue Book, Section 10.1, pages 101-104.)

Example of overlapping boxes:

Practice with translate, rotate, and scale:

More complex example:

Other complex examples:


Revision date: 2002-11-06. (Please use ISO 8601, the International Standard Date and Time Notation.)