[comp.lang.postscript] Christmas cards

anw@nott-cs.UUCP (12/03/88)

	We're thinking of doing our Christmas cards on the LW this year.
("We" == family, not department!)  Give-or-take, the idea is to print an
A4 sheet so that it can be folded into 4 to make an A6 front picture
(snowman, tree, robin, pretty stars or whatever, possibly randomised) and
an inside greeting, possibly personalised.  This can't be an original idea!
Anyone already done any good designs, or got any other ideas?

	As a counter-bargain, here is a script I wrote last year to do
little name-plates for Christmas Dinner.  Needs a LW+ with Z-Dingbats,
and it's *very* slow the first time while all the stars get cached (at
least, I assume that's the problem);  second pages & re-runs run OK.
Do with it as you will.

----------------------------- [cut here] --------------------------------------
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  Nameplates.PS
# Wrapped by anw@tuck on Fri Dec  2 19:17:13 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f Nameplates.PS -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Nameplates.PS\"
else
echo shar: Extracting \"Nameplates.PS\" \(2396 characters\)
sed "s/^X//" >Nameplates.PS <<'END_OF_Nameplates.PS'
X%	Nameplates script.  This is *not* a conforming document, if it matters.
X
X/names [	(Samantha)	(Anne)		(Andy)
X		(Frances)	(Colin)		(Dacia)
X		(Joy)		(Martyn)	(Lynne)
X		(David)
X	] def
X/fontsize 20 def
X/nlength names length def
X
X%	"names" is the list of names for which plates are required.
X%	Re-define ad lib.  Nothing else should need changing unless
X%	very long names are used, in which case "fontsize" should
X%	be reduced.  There should probably be some dotted lines showing
X%	where to cut and fold, but users are assumed to be intelligent).
X%	Warning:  the *first* page is usually *sloooooowwww*;  subsequent
X%	pages, or re-runs, are much faster once all the stars are cached.
X
X/inch { 72 mul } def
X
X%	for A4 ...
X/xmax 8.25 inch cvi def
X/ymax 11.75 inch cvi def
X
X/stars [ (a) (b) (c) (d) (e) (f) (g) (h) (i)
X	 (j) (k) (A) (B) (C) (D) (E) (F) (G)
X	 (H) (I) (J) (K) (L) (M) (N) (O) (P)
X	 (Q) (R) (S) (T) (U) (V) (W) (X) (Y) (Z) ] def
X/nn stars length def
X
X/plonk { rand xmax mod rand ymax mod moveto stars rand nn mod get show } def
X/radius fontsize 80 div inch def
X/baseline fontsize -4 div def
X
X{	nlength 0 le { exit } if
X
X	0 setgray
X	0 0 moveto xmax 0 rlineto 0 ymax rlineto xmax neg 0 rlineto
X	closepath fill
X	1 setgray
X
X	/ZapfDingbats findfont  6 scalefont setfont 300 { plonk } repeat
X	/ZapfDingbats findfont  8 scalefont setfont 300 { plonk } repeat
X	/ZapfDingbats findfont 10 scalefont setfont 300 { plonk } repeat
X	/ZapfDingbats findfont 12 scalefont setfont 300 { plonk } repeat
X	/ZapfDingbats findfont 14 scalefont setfont 300 { plonk } repeat
X	/ZapfDingbats findfont 16 scalefont setfont 150 { plonk } repeat
X	/ZapfDingbats findfont 20 scalefont setfont  75 { plonk } repeat
X
X	0.5 inch setlinewidth xmax 2 div 0 moveto 0 ymax rlineto stroke
X
X	ymax 10 div setlinewidth
X	3 4 19 { ymax 20 div mul 0.35 inch add 0 exch moveto xmax 0 rlineto
X			stroke } for
X
X	/ZapfChancery-MediumItalic findfont fontsize scalefont setfont
X
X	1 4 19 { /j exch def
X	    1 2 3 { /i exch def
X		gsave	xmax 4 div i mul ymax 20 div j mul 0.35 inch add
X			translate
X			/nlength nlength 1 sub def
X			nlength 0 ge {
X				/aname names nlength get def
X				/offset aname stringwidth pop 2 div def
X				1 setgray
X				offset neg radius neg moveto
X				offset 0 radius -90 90 arc
X				offset neg 0 radius 90 -90 arc fill
X				0 setgray
X				offset neg baseline moveto aname show } if
X		grestore } for } for
X
X	showpage } loop
X
X
END_OF_Nameplates.PS
echo shar: 1 control character may be missing from \"Nameplates.PS\"
if test 2396 -ne `wc -c <Nameplates.PS`; then
    echo shar: \"Nameplates.PS\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0

-- 
Andy Walker, Maths Dept., Nott'm Univ., UK.
anw@maths.nott.ac.uk

rcd@ico.ISC.COM (Dick Dunn) (12/06/88)

In article <597@tuck.nott-cs.UUCP>, anw@nott-cs.UUCP writes:
> 	We're thinking of doing our Christmas cards on the LW this year.
> ("We" == family, not department!)  Give-or-take, the idea is to print an
> A4 sheet so that it can be folded into 4 to make an A6 front picture...
. . .
>...Anyone already done any good designs, or got any other ideas?

We did this last year.  Here's how to lay out the card if you want a more-
or-less normal size with printing on the outside front and the "right" side
of the inside of the card, using card stock.  It produces a card which has
a final size of 1/4 an 8/5x11...you can even get envelopes which fit this
size.  Lay out the page like this:
		+-------+-------+
		|        Outside|
		|         stuff |
		|               |
		+       +       +
		|Inside         |
		| stuff         |
		|(invert)       |
		+-------+-------+
The easy way to do this is to put the origin at the center of the page
(where I put the "+"), do the outside stuff, rotate 180 and do the inside
stuff.

Now, once you've printed this on a piece of paper, you have a master--take
it somewhere you can get good copies made on card stock (colors are
usually available) and have them print both sides.  The front sides are
printed as shown; the back sides are printed =>upside down<=.  (Have them
check it after one copy to be sure they get it right, because it's not the
usual way.)

Now you've got your cards, two to a sheet.  Cut them in half with a paper
cutter, or the copy center may be able to do this very neatly for you.

To fold card stock without cracking it or getting an erratic fold, first
crease it slightly on the OUTside of the fold.  (This pre-stretches the
paper fiber which will wrap the larger radius.)  Use something under the
card with a little bit of give, like a blotter or a few pieces of paper;
use a ball-end stylus, soldering aid, or something like that to make the
crease.

It's all a lot simpler than I'm making it sound...it'll take an afternoon
or so.
-- 
Dick Dunn      UUCP: {ncar,nbires}!ico!rcd           (303)449-2870
   ...I'm not cynical - just experienced.

jeff@ism780c.isc.com (Jeff Copeland) (12/09/88)

In article <597@tuck.nott-cs.UUCP> anw@maths.nott.ac.uk (Dr A. N. Walker) writes:
>
>	We're thinking of doing our Christmas cards on the LW this year.
> ....
>
>	As a counter-bargain, here is a script I wrote last year to do
>little name-plates for Christmas Dinner.  Needs a LW+ with Z-Dingbats,
>and it's *very* slow the first time while all the stars get cached (at
>least, I assume that's the problem);  second pages & re-runs run OK.
>Do with it as you will.

Starting from the name-plate code, I wrote some PostScript code to do a
two-color card, and added some (very simple-minded) code to do inside
text.  Three pages are printed as camera-ready copy for the front of the
card.  They are labelled "red", "green" and "green minus red"; the last
page is the same as the green page, but with the red stars "dropped out",
so that red ink is not printed over green ink.  (In practice, paper plate
photo-offset printing from 300 dpi laser printed masters may not provide
exact enough registration to prevent green/red bleeding.)

These are set up for printing on 9 x 6.25 inch stock, which is then folded
in half.  In the US, this is a standard wedding invitation size, called "6
bar", or just to confuse things, "A6" stock.  Envelopes are available to
match.  This size paper is often sold in American stationary stores in
small quantity under the name "paper by the pound".  To print in a
different size, change the values of xmax and ymax.

============================ cut here ========================
%!
%	Winter Holiday card.

/inch { 72 mul } def

% the x and y dimensions of the card
/xmax 4.5 inch cvi def
/ymax 6.25 inch cvi def

% crop marks
/CropMarks {
    .005 inch setlinewidth
    xmax ymax 1 inch add moveto 0 -.75 inch rlineto stroke 
    xmax 1 inch add ymax moveto -.75 inch 0 rlineto stroke 
    xmax -1 inch moveto 0 .75 inch rlineto stroke 
    xmax 1 inch add 0 moveto -.75 inch 0 rlineto stroke 
    0 -1 inch moveto 0 .75 inch rlineto stroke 
    -1 inch 0 moveto .75 inch 0 rlineto stroke 
    0 ymax 1 inch add moveto 0 -.75 inch rlineto stroke 
    -1 inch ymax moveto .75 inch 0 rlineto stroke 
} def

% scale and translate
/PageSetup {
    .75 inch .75 inch translate
    %% add scaling here to print larger masters, which
    %%  can then be shot down for higher apparent resolution.
    CropMarks
} def

% page label
/PageLabel {
    xmax .5 inch add ymax .5 inch add moveto
    /Helvetica findfont 10 scalefont setfont show
} def

% random number seed
/seed 212695 def

/stars [ (a) (b) (c) (d) (e) (f) (g) (h) (i)
	 (j) (k) (A) (B) (C) (D) (E) (F) (G)
	 (H) (I) (J) (K) (L) (M) (N) (O) (P)
	 (Q) (R) (S) (T) (U) (V) (W) (X) (Y) (Z) ] def
/nn stars length def

/plonk { rand xmax mod rand ymax mod moveto stars rand nn mod get show } def

% Do 100 stars of varying sizes
/Stars {
    /ZapfDingbats findfont 14 scalefont setfont  30 { plonk } repeat
    /ZapfDingbats findfont 16 scalefont setfont  25 { plonk } repeat
    /ZapfDingbats findfont 20 scalefont setfont  45 { plonk } repeat
} def


% red set of stars
PageSetup
seed srand   Stars  %% red set
(red) PageLabel
showpage


% green set of stars
PageSetup
Stars   %% green set
(green) PageLabel
copypage
    % now erase the red set, so there's no overlap
1 setgray  
seed srand  Stars  
0 setgray
(green minus red) PageLabel
showpage


% inside text
PageSetup
(text) PageLabel
/Text { 
    moveto show
} def
/ZapfChancery-MediumItalic findfont 16 scalefont setfont
(Wishing you joyous) 1.5 inch 5 inch Text
(winter holidays) 1.6 inch 4.75 inch Text
(and a wonderful 1989.) 1.7 inch 4.5 inch Text
showpage
============================ cut here ========================

wm@ogccse.ogc.edu (Wm Leler) (12/12/88)

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-=-=-=-=-=-=-=-=-=-=-

jos@idca.tds.PHILIPS.nl (Jos Vos) (12/19/88)

In article <1901@ogccse.ogc.edu> wm@ogccse.UUCP (Wm Leler) writes:

>Here is a program I used a few years ago to print out Christmas cards.

I'm sure it's a nice card... but it results (always) in a Fatal system
error on my LaserWriter IINTX. Do more people have this problem?
The system error is:

	Fatal system error @ 0X400ac358

Can the program slightly be changed to circumvent the problem?

And many thanks for this new program to test new PostScript laserprinters :-)

-- 
-- ######   Jos Vos   ######   Internet   jos@idca.tds.philips.nl   ######
-- ######             ######   UUCP         ...!mcvax!philapd!jos   ######

dplatt@coherent.com (Dave Platt) (12/20/88)

In article <712@ssp15.idca.tds.philips.nl> jos@idca.tds.PHILIPS.nl (Jos Vos) writes:
> In article <1901@ogccse.ogc.edu> wm@ogccse.UUCP (Wm Leler) writes:
> 
> >Here is a program I used a few years ago to print out Christmas cards.
> 
> I'm sure it's a nice card... but it results (always) in a Fatal system
> error on my LaserWriter IINTX. Do more people have this problem?
> The system error is:
> 
> 	Fatal system error @ 0X400ac358

Yup.  I spent some time trying to debug this puppy today, after one of
our programmers reported that it was causing our LaserWriter Plus to
reset and spit out a new startup-page.

I've been able to isolate the problem (somewhat) to the code "fillpage"
proc.  This proc is called, but never returns... I'm not sure why, as
I'm not a PostScript heavy.  I'd _guess_ that the stack is somehow being
graunched... but I'm far from certain.

A fixed version of this program would be much appreciated!
-- 
Dave Platt    FIDONET:  Dave Platt on 1:204/444        VOICE: (415) 493-8805
  UUCP: ...!{ames,sun,uunet}!coherent!dplatt     DOMAIN: dplatt@coherent.com
  INTERNET:   coherent!dplatt@ames.arpa,    ...@sun.com,    ...@uunet.uu.net 
  USNAIL: Coherent Thought Inc.  3350 West Bayshore #205  Palo Alto CA 94303