Article View: comp.lang.postscript
Article #8197Re: curveto heart wanted
From: Glenn Reid
Date: Thu, 06 Apr 1989 15:50
Date: Thu, 06 Apr 1989 15:50
56 lines
1721 bytes
1721 bytes
In article <5060@cs.Buffalo.EDU> milun@cs.Buffalo.EDU (Davin Milun) writes:
>I'm looking for Postscript code which draws a heart shape (not a biological
>one!). I assume that curveto's would be the easiest, or using arc's.
I wrote this program a long time ago (and it exemplefies a lot of bad
programming, so please don't flame me). It is really a bumper sticker,
and I thought it would be entertaining to post the whole thing, but you
have to surgically remove the heart from the middle of the file
yourself (it's a very short program).
Cheers,
Glenn Reid
Adobe
%!
% print a PostScript bumper sticker...
/LMargin 55 def
/in. {72 mul} def
90 rotate 0 -612 translate
/PTsize 150 def
/Times-Roman findfont PTsize scalefont setfont
LMargin 350 moveto
gsave
(PS ) show
/saveobj save def
/showpage {} def
340 310 translate
1.8 1.8 scale
/heart {
/height exch def
currentpoint /Y exch def /X exch def
/half height 2 div def
half neg half rlineto
half neg half
0 height
half half
rcurveto
half half
height 0
half half neg
rcurveto
closepath
} def
0 0 moveto
1 in. heart
.5 setgray
fill
showpage
saveobj restore
grestore
0 PTsize .9 mul neg rmoveto
({ honk } if) show
showpage
Technical Details
Message-ID:
<733@adobe.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!accuvax.nwu.edu!tank!ncar!ames!pasteur!ucbvax!decwrl!adobe!greidReferences:
<5060@cs.Buffalo.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!accuvax.nwu.edu!tank!ncar!ames!pasteur!ucbvax!decwrl!adobe!greid From: greid@adobe.com (Glenn Reid) Newsgroups: comp.lang.postscript Subject: Re: curveto heart wanted Message-ID: <733@adobe.UUCP> Date: 6 Apr 89 15:50:59 GMT References: <5060@cs.Buffalo.EDU> Sender: news@adobe.COM Reply-To: greid@adobe.COM (Glenn Reid) Organization: Adobe Systems Incorporated, Mountain View Lines: 56