🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #7702

Re: Christmas cards

#7702
From: Wm Leler
Date: Mon, 12 Dec 1988 03:55
141 lines
4322 bytes
Here is a program I used a few years ago to print out Christmas cards.
Please, if anyone wants to use this, do make a few changes to it
(show some originality!).  Nice features include randomly placed
(Zapf-Dingbats) snowflakes, and a place near the end to customize the
greeting.  The real win of PostScript generated cards is that you can
print an individualized customized greeting for each and every card,
with not much effort (you know, sort of like those letters you get
addressed to the "Vax" household on "Computer Science Department"
street).  Note also that these cards looked much, much nicer printed on
heavy textured stock (it even hid the jaggies a bit).  Have fun!

Wm Leler

-=-=-=-=-=-=-=-=-=-=-christmas card-=-=-=-=-=-=-=-=-=-=-

/inch {72 mul} def

0 11 inch translate -90 rotate	% landscape format

% move to next line of output, VS is vertical spacing
/newline {
	currentpoint VS sub exch pop	% new y coordinate
	dup BM lt {exit} if		% below BM?
	LM exch moveto } def

% perform a newline if necessary (beyond RM)
/nlIfNec { currentpoint pop RM gt {newline} if } def

% takes a string argument, and assumes that TM BM LM RM and VS are defined
/fillpage {
	/strg exch def
	LM TM VS sub moveto
	{ {pop pop nlIfNec} strg kshow } loop
	} def

% center a string on the page
/centerx {
	dup	% save a copy of the string
	LM RM add exch stringwidth pop sub 2 div
	} def

/maxrand 2 31 exp 1 sub def
/randing {
	rand maxrand div RM LM sub mul LM add
	rand maxrand div TM BM sub mul BM add
	moveto
	/strg exch def
		{ pop pop
		rand maxrand div RM LM sub mul LM add
		rand maxrand div TM BM sub 40 sub mul BM add
		moveto }
	strg kshow
	} def

/TM 3.95 inch def
/BM .3 inch def
/LM .3 inch def
/RM 5.2 inch def

/VS 9 def

% page 1
gsave
5.5 inch 0 translate	% bottom right

/ZapfChancery-MediumItalic findfont 7 scalefont setfont
0 setgray	% black
(Happy Hanukkah   Joyous Noel   Happy Holidays   Merry Christmas   Season's Greetings   ) fillpage

% border
newpath LM BM moveto LM TM lineto
RM TM lineto RM BM lineto closepath
gsave
0 setgray	% black
8 setlinewidth stroke
grestore
1 setgray	% white
2 setlinewidth stroke


/ZapfChancery-MediumItalic findfont 67 scalefont setfont
(Greetings) dup
.9 setgray	% light gray
centerx 10 sub 2.7 inch moveto show
0 setgray	% black
1.8 setlinewidth
centerx 10 sub 2.7 inch moveto true charpath stroke

/ZapfChancery-MediumItalic findfont 30 scalefont setfont
(from) dup
.9 setgray	% light gray
centerx 5 sub 1.8 inch moveto show
0 setgray	% black
1 setlinewidth
centerx 5 sub 1.8 inch moveto true charpath stroke

/ZapfChancery-MediumItalic findfont 40 scalefont setfont
([your name here!]) dup
.9 setgray	% light gray
centerx 10 sub 1 inch moveto show
0 setgray	% black
1.5 setlinewidth
centerx 10 sub 1 inch moveto true charpath stroke
grestore

% page 2
gsave
11 inch 8.5 inch translate 180 rotate
/ZapfDingbats findfont 25 scalefont setfont
(\076\101\102\103\400\105) randing	% stars cross
(\117\125\142\246\247\244\252) randing
(\132\410\436) randing
.4 setgray
(\144\145\146\402\406) randing	% snowflakes
0 setgray
/ZapfDingbats findfont 45 scalefont setfont
(\144\145\146\402\406) randing	% snowflakes
/ZapfDingbats findfont 15 scalefont setfont
(\144\145\146\402\406) randing	% snowflakes
/ZapfDingbats findfont 10 scalefont setfont
(\144\145\146\402\406) randing	% snowflakes
/ZapfDingbats findfont 6 scalefont setfont
(\144\145\146\402\406) randing	% snowflakes
grestore

% page 3
gsave
0 setgray
5.5 inch 8.5 inch translate 180 rotate
/ZapfChancery-MediumItalic findfont 30 scalefont setfont
([To my friends, the Dingbats]) centerx 5 sub 3 inch moveto show
grestore

% page 4
gsave
/Bookman-DemiItalic findfont 10 scalefont setfont
(Card design stolen from Wm!) centerx .8 inch moveto show
grestore

showpage
-=-=-=-=-=-=-=-=-=-=-christmas card-=-=-=-=-=-=-=-=-=-=-
Technical Details
Message-ID: <1901@ogccse.ogc.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!ogccse!wm
References: <597@tuck.nott-cs.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!ogccse!wm
From: wm@ogccse.ogc.edu (Wm Leler)
Newsgroups: comp.lang.postscript
Subject: Re: Christmas cards
Message-ID: <1901@ogccse.ogc.edu>
Date: 12 Dec 88 03:55:48 GMT
References: <597@tuck.nott-cs.UUCP>
Reply-To: wm@ogccse.UUCP (Wm Leler)
Organization: Oregon Graduate Center, Beaverton, OR
Lines: 141