%!PS-Adobe-2.0
% CS-UTSA logo, by N Wagner, 2008-03-08
% NOW ... fading shadow!!
% coords in points.  72 pts = 1 in
% origin = lower left corner of page
% replace orange, blue, and white below with other colors
/orange { Orange } def
/blue { DarkBlue } def
/colincr 0.4 def % controls how bright shadow colors are (0.6 = full)
/fadeincr 0.96 def % controls how fast shadow fades (closer to 1 = slower)
% here are some colors.  Try lighter blues, redder orange
/Orange2 {1.0 0.7 0.0 setrgbcolor} def
/RedishOrange2 {1.0 0.6 0.0 setrgbcolor} def
/RedOrange2 {1.0 0.5 0.0 setrgbcolor} def
/Blue2 {0 0 1 setrgbcolor} def
/Green2 {0 1 0 setrgbcolor} def
/LightBlue2 {0.3 0.3 1 setrgbcolor} def
/DarkerBlue2 {0 0 0.8 setrgbcolor} def
/DarkBlue2 {0 0 0.6 setrgbcolor} def
% other color model
/Yellow{0 0 1 0 setcmykcolor}def
/RedOrange{0 0.77 0.87 0 setcmykcolor}def
/Orange{0 0.61 0.87 0 setcmykcolor}def
/Black{0 0 0 1 setcmykcolor}def
/White{0 0 0 0 setcmykcolor}def
/LBlue {0.8 0.8 0 0 setcmykcolor}def
/VLBlue {0.6 0.6 0 0 setcmykcolor}def
/Blue {1 1 0 0 setcmykcolor}def
/DarkBlue {1 1 .2 0 setcmykcolor}def
/DarkerBlue {1 1 .4 0 setcmykcolor}def
/VeryDarkBlue {1 1 .6 0 setcmykcolor}def
/Helvetica-Bold findfont 100 scalefont setfont

/xstart 100 def % start of text, x coord
/ystart 200 def % start of text, y coord
/xsstart 100 def % shadow start for clipping rectangles
/ysstart 200 def % shadow start for clipping rectangles

/nextchar {  % stack: color kern str1 str2
   /col exch def % save color value
   /kern exch def % save kern amount
   /startstr exch def % save first string
   /nextchr exch def % save string = next char
   startstr stringwidth pop % distance along string
   newpath % path more expllicit
      xstart add kern sub ystart moveto % starting point
      nextchr false charpath % make a path
   closepath % path more expllicit
   % put in fattened character
   gsave % first fat outline
      col 1 eq { blue } if
      col 2 eq { orange } if
      stroke
   grestore % then filled in
   col 1 eq { blue } if
   col 2 eq { orange } if
   fill
} def

/Coff 84 def % how far up to move C
/Coff2 3 def % how far left to move C

% later will change linewidth
7.8 setlinewidth % fat line

% Blue and Orange
(U) () 0  1 nextchar
(T) (U) 17 1 nextchar
(A) (UTS) 77 1 nextchar
/ystart ystart 2 add def
(S) (UT) 45 2 nextchar
/xstart xstart Coff2 sub def
/ystart ystart Coff add def 
(C) (UT) 45  2 nextchar
/xstart xstart Coff2 add def
/ystart ystart Coff sub def
/ystart ystart 2 sub def

% Now put in the shadow.  A lot of ad hoc stuff
%  but just the font declaration is the main thing
/Helvetica-Bold findfont  [105 0 80 -60 0 0] makefont setfont
% The characters were a little too fat
5 setlinewidth 

/shadow { % stack: colparam
   /colparam exch def
   /ystart ystart 15 sub def
   /blue { colparam colparam 0 0 setcmykcolor } def
   (U) () 0  1 nextchar
   /ystart ystart 15 add def

   /ystart ystart 15 sub def
   (T) (U) 17 1 nextchar
   /ystart ystart 15 add def

   /ystart ystart 15 sub def
   (A) (UTS) 77 1 nextchar
   /ystart ystart 15 add def

   /orange { 0 colparam colparam 1.5 mul 0 setcmykcolor } def
   /ystart ystart 15 sub def
   /ystart ystart 2 add def
   (S) (UT) 45 2 nextchar
   /xstart xstart Coff2 sub def
   /xstart xstart 60 add def
   /ystart ystart Coff add def 
   /ystart ystart Coff sub def 
   /ystart ystart Coff sub def 
   % this was the final magic number to move C into position
   /ystart ystart 33.27 add def 
   (C) (UT) 45  2 nextchar
   /xstart xstart Coff2 add def
   /xstart xstart 60 sub def
   /ystart ystart Coff sub def
   /ystart ystart Coff add def
   /ystart ystart Coff add def
   /ystart ystart 2 sub def
   /ystart ystart 15 add def
   /ystart ystart 33.27 sub def 
} def

/cliprect { % stack: h1 h2
   /h2 exch def % height of clipping rectangle (won't change)
   /h1 exch def % how far down clipping rectangle starts
   newpath
     xsstart ysstart h1 sub moveto
     0 h2 neg rlineto
     500 0 rlineto
     0 h2 rlineto
   closepath
   clip
} def

/h2 5 def
/h1 1 def

% start of loop
{  clipsave % needed for multiple clipping paths (??)
      h1 h2 cliprect
      colincr shadow
   cliprestore % needed for multiple clipping paths (??)
   /h1 h1 1 add def
   /colincr colincr fadeincr mul def % fade color parameter
   h1 120 gt { exit} if
} loop

showpage