CS 3723 Programming Languages
Spring 2001 -- Postscript Assignment
For this assignment, you are to write a program in Postscript that
will print a ``business card'', either for you, or for some fictitious
individual or company.
Here are requirements for the assignment:
- The initial card must be exactly 2 inches by 3.5 inches.
With one run, translating the card if necessary, print a
single copy of your card on a sheet of paper.
(It might be easiest to put the lower left corner of the card
at the origin (0, 0) of the Postscript coordinates, that is,
the lower left corner of the page. Note that your card should
be 144 points by 252 points.)
- Produce another copy of the same card, but
magnified by a factor of 2.5 and printed horizontally, so that
the final card will be 5 inches by 8.75 inches on one sheet.
(You will need to rotate by 90 degrees, scale by 2.5 in both
x and y directions, and translate by some amount. It will require
some thought or experimentation to decide which order to do the
three operations in.)
- In a third run produce at least 5 copies of the output card
at the initial size. The Postscript
code that produces these 5 copies should employ a Postscript
loop. (See pages 51-52 and Chapter 7 of the
Blue Book (PDF, 847k). I also handed out source that
did something similar to this.)
- The outer 2 inch by 3.5 inch boundary must be stroked with a
thin line.
- At least one piece of text on the card must either be centered
or right justified, using the stringwidth function, so that the
text would remain centered or right-justified even if the font
size is changed. (See the Blue Book, pages 42-43 for right justification,
and pages 58-59 for centering. See also my handout with a card on it.)
Here are some additional features that I would like to see you
incorporate into your card:
- The use of some ``graphic object'', e.g., some picture made up
of one or more paths.
- The use of an outline around characters in a string. (See the
example on page 98 of the Blue Book.)
- The use of a clipping path, especially one involving a string
of characters. (See the Blue Book, pages 103-104.)
Finally, try to make it look interesting. Be creative. Don't just
copy the book or one another.
Good luck!
Revision date: 2001-04-23.
(Please use ISO
8601, the International Standard.)