CS 3723/3721 Programming Languages
Postscript Recitation 2: Business Card
A Business Card in Postscript:
For this recitation, 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 recitation:
- 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).)
- 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 or my card below.
Examples of Cards:
Two cards from the Blue Book plus one of my own:
- The Diamond Cafe on pages 41-45:
.html,
.ps,
.pdf.
- Omaha (actually a logo) on pages 57-59:
.html,
.ps,
.pdf.
- Here is one of my own cards:
.html,
.ps,
.pdf.
Revision date: 2002-11-06.
(Please use ISO 8601,
the International Standard Date and Time Notation.)