 use PostScript::Simple;$p = new PostScript::Simple(landscape=>0, xsize=>3.5*72, ysize=>2*72, eps=>1, papersize=>"a4", colour=>1, units=>"pt");$p->box(0,0,3.5*72,2*72);$p->setfont("Times-Roman", 10); for $ty (['Drew Perttula',78],['510-841-1265',50],['http://bigasterisk.com',32],['drewp@bigasterisk.com',24],['Card code at http://bigasterisk.com/card',8]) {@l=@$ty;$p->text(245,$l[1],$l[0],'right');$p->setfont("Times-Roman",7) if $l[1]==78 }$p->{pspages}.="gsave 3 u setlinewidth .8 setgray newpath 246 u 72 u moveto 156 u 72 u lineto stroke\n";$p->{pspages}.="173 u 119 u moveto 165 u 17 u lineto 123 u 25 u lineto 114 u 37 u lineto 103 u 34 u lineto 109 u 23 u lineto 102 u 22 u lineto 97 u 30 u lineto 85 u 28 u lineto 94 u 14 u lineto 72 u 12 u lineto 72 u 126 u lineto closepath clip newpath "."122 u 110 u moveto 190 u 100 u 165 u 24 u 80 u 22 u curveto "."80 u 23.5 u lineto 160 u 24 u 180 u 100 u 121 u 102 u curveto "."closepath fill grestore\n";$xc=75;$yc=72;$p->setfont("Courier", 2.9);$ltrpacing=1.320;$csp=.6;$fd=-.24; open(IN,"card.pl");$code=join("",<IN>);$f=1;$start=0; while($f>0){ for $i (0..5){ $ang=(($i+1)%6)*60+2; ltr(f2(-1,$f), f1(-1),$ang,$csp) if $start++; ltr(f1(-1), f1(1),$ang+90,$csp*5); ltr(f1(1), f2(1,$f+($fd*($i==5))),$ang+180,$csp);} $f+=$fd;} $p->output("card.ps"); sub f1 { my($side)=$_[0]; return ptc(58+14*$f,$ang +$side*(2+10*$f));} sub f2 { my($side,$f)=@_; return ptc(5+24*$f,$ang +$side*30);} sub ptc { my($r,$deg)=@_; return ($xc+$r*cos($deg*.017453),$yc+$r*sin($deg*.017453));} sub ltr { my($x1,$y1,$x2,$y2,$ang,$csp)=@_; my($dx,$dy,$d,$x,$y);$dx =$x2-$x1;$dy =$y2-$y1;$d = sqrt($dx**2+$dy**2);$x=$x1;$y =$y1;$x+=$dx/$d*$csp;$y+=$dy/$d*$csp; while(abs($x-$x1)<abs($dx)-$csp || abs($y-$y1)<abs($dy)-$csp){ if($code=~s/^(.)//) {$char=$1;$char ="\\$char" if $char=~/[\(\)\\]/;$p->{pspages}.="gsave $x u $y u moveto $ang rotate ($char) show grestore\n";} $x+=$ltrpacing*$dx/$d;$y+=$ltrpacing*$dy/$d;} } 