🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #6674

Saint Valentine's Day card in PostScript

#6674
From: Anthony J Stieber
Date: Tue, 16 Feb 1993 01:01
158 lines
4690 bytes
Here's a Saint Valentine's Day card written in PostScript.  It uses the
ZapfDingbats font.  Given that Valentine's Day was yesterday it says
"Happy Belated Valentines [sic] Day!" on the cover.  It's perfect for
procrastinators like me.  There is also some sample text on the inside
that can be readily changed to your own heartfelt words.  I haven't
worked on this for months.  Feel free to add various features such as:

        add an "nonprocrastinator" flag for next year
        correct the punctuation errors
        color support (400 point heart looks better in red than black)
        clean up the ugly code
        fix heart&arrow code (synthesized arrow code is unused)
        easier to change cover and inside message
        automatic message justification
        premade messages
        more cover designs (N hearts vs one fixed position heart)
        script to take a mailing list and personalize each card

And probably other things I can't think of right now.  I hope this
posting restarts a trend in posting cards for various holidays.

Copyright 1992, Anthony Stieber, distributed under the Free Software
Foundation General Public License.

--------------apply sharp object here---------------------
%!PS
% a Valentines Day card

% Various useful PostScript code
% CAE Lab, 920213, Anthony Stieber

% some handy abbreviations
/sh { show } def
/ss { scalefont setfont } def
/cp {currentpoint} def
/TR /Times-Roman findfont def
/T-B /Times-Bold findfont def
/T-I /Times-Italic findfont def
/TB-I /Times-BoldItalic findfont def
/H /Helvetica findfont def
/H-BO /Helvetica-BoldOblique findfont def
/ZC-MI /ZapfChancery-MediumItalic findfont def
/ZD /ZapfDingbats findfont def
/P-I /Palatino-Italic findfont def
/S /Symbol findfont def
/topleft { 0  825 moveto } def

% an easy way to do things by inches
/in { 72 mul } def

% a little routine to center text
%    duplicatate the string, get its width, divide by two
%    then move to the left that amount
/cn { dup stringwidth pop 2 div neg 0 rmoveto } def

% procedures to move to the upperleft of the four portrait quandrants
/topleftQ { 0 825 moveto } def
/toprightQ { 315 825 moveto } def
/botleftQ { 0 412 moveto } def
/botrightQ { 315 412 moveto } def

%some code to rotate then shift into an upside down space.
/upsidedownpage { 180 rotate -600 -825 translate } def

%arrow pointing downwards, 20 points high and wide.
%to complement arrowtail
/arrowhead
{
			%head
	1 setlinewidth
	8 20 rlineto 
	-16 0 rlineto
	8 -20 rlineto
			%tail
			%move to behind head
	5 20 rmoveto
	0 20 rlineto
	-10 0 rlineto
	0 -20 rlineto
%	0 setgray fill
	stroke
} def
%a simple tail of an arrow, 20 points high and wide
%to complement arrowhead 
/arrowtail
{
			%right side of shaft
	1 setlinewidth
	10 0 rlineto
	0 20 rlineto
			%feather
	5 5 rlineto
	0 10 rlineto
	-10 -10 rlineto
			%start left feather
	-10 10 rlineto
	0 -10 rlineto
	5 -5 rlineto
			%start left side of shaft
	0 -20 rlineto
	10 0 rlineto
%	0 setgray fill
	stroke
} def




%the inside right of the card
botrightQ
%shift down and the right
ZC-MI 50 ss
135 -120 rmoveto currentpoint (Happy Belated) cn show
moveto 0 -55 rmoveto currentpoint (Valentines Day!) cn show

%vine and heart
moveto -90 -50 rmoveto cp ZD 15 ss (\246) show
H 10 ss			 ( Insert a nice message here or if you ) show
moveto 0 -15 rmoveto cp (don't feel creative, just leave it blank.) show
%vine and heart
ZD 15 ss (\246) show

TB-I 12 ss
moveto 20 -25 rmoveto cp (stick your name here) show

%now do the front of the card
upsidedownpage
botrightQ
5 -330 rmoveto
ZD 400 ss
% a heart
(\252)
show
% true charpath stroke
%(M) show

botrightQ
-25 -125 rmoveto
ZD 100 ss
% an angled arrow
(\364) show
%(\\) show
botrightQ
% 130 -290 rmoveto right on the line!
147 -265 rmoveto
% an angled arrow
(\364) show
%(\\) show

%the back of the card
botleftQ
75 -335 rmoveto currentpoint

P-I 10 ss (Copyright ) show
S 10 ss (\343) show P-I 10 ss ( 1992, Anthony Stieber) show
moveto 0 -15 rmoveto currentpoint
(anthony@csd4.csd.uwm.edu) show
showpage
Technical Details
Message-ID: <1lpedtINNar7@uwm.edu>
Path: arc1-ca.pugleaf.net!wupost!howland.reston.ans.net!zaphod.mps.ohio-state.edu!uwm.edu!csd4.csd.uwm.edu!anthony

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wupost!howland.reston.ans.net!zaphod.mps.ohio-state.edu!uwm.edu!csd4.csd.uwm.edu!anthony
From: anthony@csd4.csd.uwm.edu (Anthony J Stieber)
Newsgroups: comp.lang.postscript,alt.sources
Subject: Saint Valentine's Day card in PostScript
Date: 16 Feb 1993 01:01:49 GMT
Organization: Computing Services Division, University of Wisconsin - Milwaukee
Lines: 159
Distribution: world
Message-ID: <1lpedtINNar7@uwm.edu>
NNTP-Posting-Host: 129.89.7.4
Originator: anthony@csd4.csd.uwm.edu