🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #1592

Postscript Doorsign maker

#1592
From: Dan Judd
Date: Mon, 22 Jan 1990 17:52
128 lines
3925 bytes
I wrote this a while back so I could fill in the "YOUR NAME HERE"
slots next to my office door. I ended up making signs for a large part
of the department, plus some for people where my wife works. I would recommend
printing it out so you know which strings to change to what. If you want
things centered etc you have to do it by hand, I didn't feel like 
adding code to make it automatic (lazy).

Dan Judd
danjudd@thor.acc.stolaf.edu
Just tryin' to put a bit of PostScript back in comp.lang.postscript :-)

----------------Cut here for PostScript------------------
%! 
%A Door Sign creator 
%by Dan Judd
%
%Change the various strings to what you want
%the named constants should be more or less self
%explanitory
%
%User  value defs
% 
/fname (First  ) def
/lname (Last  ) def
/backstring (Background String ) def
/boxht 210 def
%/boxwd 150 def
/boxwd 360 def
/backht boxht 3 mul 100 add def
/backwd boxwd 20 add def
/backstrht 4 def
/backpoint 4 def
/shadelight 1 def
/shadedark 0 def
/shadelevels 33 def
/shadexdist 33 def
/shadeydist  -15 def

%
%User procedure defs
%
/line1 (This is Line One!) def
/line2 (This is Line Two!) def
/phrase {5 60 moveto  line1  show
 5 20 moveto line2  show
  }def

/phraseoutline { line1 5 60  loutline
 line2  5 20   loutline
  }def

/box {0 0 moveto 0 boxht rlineto  boxwd 0
 rlineto  0  boxht -1 mul rlineto closepath stroke 
stroke}  bind def

/logo { gsave
 box
.3 setlinewidth
/Times-Bold findfont 60 scalefont setfont
fname 5 150 loutline
lname 5 100 loutline
/Times-BoldItalic findfont 40 scalefont setfont
 /phrase load dshade
 phraseoutline 
 grestore} bind def

%
% Begin procedure library set
%
% usage string x y [ld]outline
/loutline { 3 copy 1 setgray
 moveto true charpath fill
0 setgray
 moveto false charpath stroke} bind def

/doutline { 3 copy 0 setgray
 moveto true charpath fill
1 setgray
 moveto false charpath stroke} bind def

/background {
/Times-Italic findfont backpoint scalefont setfont
0 setgray 
-10 -10 moveto backwd -10 lineto backwd backht lineto 
-10 backht lineto -10 -10 lineto fill
1 setgray
/strlen backstring stringwidth pop cvi def
/numstrings backwd strlen div ceiling cvi 2 add  def
-10 backstrht backht { dup strlen mod -1 mul 20 sub
 exch moveto
numstrings { backstring show } repeat } for
 } def

%Usage {procedure def that prints}[dl]shade
/dshade { gsave /USERPHRASE exch def
  /xshift shadexdist shadelevels div -1 mul def
  /yshift shadeydist shadelevels div -1 mul def
  /grayshift shadelight shadedark sub shadelevels div def
  /curgray shadelight def
  shadexdist shadeydist translate
  shadelevels 1 sub {
    curgray setgray USERPHRASE
    /curgray curgray grayshift sub def
    xshift yshift translate } repeat
 grestore  shadedark setgray
   USERPHRASE } def

/lshade { gsave /USERPHRASE exch def
  /xshift shadexdist shadelevels div -1 mul def
  /yshift shadeydist shadelevels div -1 mul def
  /grayshift shadedark shadelight sub shadelevels div def
  /curgray shadedark def
  shadexdist shadeydist translate
  shadelevels 1 sub {
    curgray setgray USERPHRASE
    /curgray curgray grayshift sub def
    xshift yshift translate } repeat
  grestore shadelight setgray
  USERPHRASE } def
%
%Begin execution
%
30 30 translate
background
logo
0 boxht 25 add translate logo
0 boxht 25 add translate logo
showpage
Technical Details
Message-ID: <10753@thor.acc.stolaf.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!usc!zaphod.mps.ohio-state.edu!uwm.edu!srcsip!nic.MR.NET!thor.acc.stolaf.edu!danjudd

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!usc!zaphod.mps.ohio-state.edu!uwm.edu!srcsip!nic.MR.NET!thor.acc.stolaf.edu!danjudd
From: danjudd@thor.acc.stolaf.edu (Dan Judd)
Newsgroups: comp.lang.postscript
Subject: Postscript Doorsign maker
Message-ID: <10753@thor.acc.stolaf.edu>
Date: 22 Jan 90 17:52:10 GMT
Sender: danjudd@thor.acc.stolaf.edu
Reply-To: danjudd@thor.acc.stolaf.edu (Dan Judd)
Organization: St. Olaf College, Northfield, MN
Lines: 128