"%!PS-Adobe-3.0 EPSF-3.0\n"
"%%Creator: filo 2.2 Copyright (c) 1995 David Deaven, Jennifer Corkill\n"
"%%Title: filodex\n"
"%%Pages: (atend)\n"
"%%EndComments\n"
"%%BeginProlog\n"
"%%BeginResource: procset filo\n"
"%\n"
"% PostScript program to print addresses on envelopes\n"
"%\n"
"% David Deaven <deaven@ishmael.ameslab.gov>\n"
"% Copyright (C) 1995 David Deaven and Jennifer Corkill\n"
"%\n"
"% Postal barcodes are generated from a PostScript program adapted\n"
"% from \"postal.ps\", copyright follows:\n"
"% by Tod McQuillin\n"
"% tm1d@nike.cheme.cmu.edu\n"
"% 10-Oct-1991\n"
"% Copyright (C) 1991 Tod McQuillin\n"
"% ----------------------------------------------------------------------\n"
"%  This program is free software; you can redistribute it and/or modify\n"
"%  it under the terms of the GNU General Public License as published by\n"
"%  the Free Software Foundation (version 2 or any later version).\n"
"% ----------------------------------------------------------------------\n"
"%\n"
"% Tailored for Apple LaserWriter II with letter feeder tray.\n"
"% David Deaven 1991\n"
"%\n"
"% LaserWriter Select capability added June 1994, DMD\n"
"%\n"
"% Re-tailored so that tray on HP LaserJet 4 with envelope fed\n"
"% as HP recommends will print correctly. (jlc, 6/94)\n"
"%\n"
"/reencsmalldict 12 dict def\n"
"/filoDict 50 dict def filoDict begin\n"
"\n"
"/in {72 mul} def\n"
"/cm {28.346457 mul} def\n"
"/mm {2.8346457 mul} def\n"
"\n"
"% EHEIGHT and EWIDTH define the com10 size envelope by default.\n"
"/EWIDTH 241 mm def\n"
"/EHEIGHT 105 mm def\n"
"\n"
"% XOFFSET and YOFFSET determine the shifts required for a printer.\n"
"% By default, use an Apple LaserWriter.\n"
"/XOFFSET 0 def\n"
"/YOFFSET 0 def\n"
"\n"
"/ReEncodeSmall {\n"
"  reencsmalldict begin\n"
"  /newcodesandnames exch def\n"
"  /newfontname exch def\n"
"  /basefontname exch def\n"
"\n"
"  /basefontdict basefontname findfont def\n"
"  /newfont basefontdict maxlength dict def\n"
"\n"
"  basefontdict\n"
"    { exch dup /FID ne\n"
"      { dup /Encoding eq\n"
"\t{ exch dup length array copy\n"
"\t  newfont 3 1 roll put }\n"
"\t{ exch newfont 3 1 roll put }\n"
"\tifelse\n"
"      }\n"
"      { pop pop}\n"
"      ifelse\n"
"    } forall\n"
"\n"
"  newfont /FontName newfontname put\n"
"  newcodesandnames aload pop\n"
"\n"
"  newcodesandnames length 2 idiv\n"
"    { newfont /Encoding get 3 1 roll put }\n"
"    repeat\n"
"  \n"
"  newfontname newfont definefont pop\n"
"  end\n"
"} def\n"
"/plusvec [\n"
"  8#300 /Odieresis\n"
"  8#311 /odieresis\n"
"  8#321 /Udieresis\n"
"  8#322 /udieresis\n"
"  8#323 /Adieresis\n"
"  8#324 /adieresis\n"
"  8#325 /eacute\n"
"  8#373 /germandbls\n"
"] def\n"
"/showleft { dup stringwidth pop neg 0 rmoveto show } def\n"
"/showright { show } def\n"
"/showcenter { dup stringwidth pop -.5 mul 0 rmoveto show } def\n"
"/cr {x y moveto theshow /y y spacing sub def} def\n"
"/fromaddress {\n"
"  /y exch def /x exch def\n"
"  /filofont findfont 9 scalefont setfont /spacing 10 def\n"
"  /theshow {showright} def\n"
"} def\n"
"/toaddress {\n"
"  /y exch def /x exch def\n"
"  /filofont findfont 12 scalefont setfont /spacing 14 def\n"
"  /theshow {showright} def\n"
"} def\n"
"/stamp {\n"
"  /y exch def /x exch def\n"
"  /Hevetica-Oblique findfont 10 scalefont setfont /spacing 11.5 def\n"
"  /theshow {showcenter} def\n"
"} def\n"
"\n"
"/barcodebits [\t\t% From \"A Guide to Business Mail Preparation\"\n"
"  (11000)\t%0\t% USPS Brochure/Pamphlet\n"
"  (00011)\t%1\n"
"  (00101)\t%2\n"
"  (00110)\t%3\n"
"  (01001)\t%4\n"
"  (01010)\t%5\n"
"  (01100)\t%6\n"
"  (10001)\t%7\n"
"  (10010)\t%8\n"
"  (10100)\t%9\n"
"  ] def\n"
"\n"
"/bit1 {\t\t\t% Draw a 1 bit of the POSTNET Barcode\n"
"  0 .125 in rlineto\n"
"  1 in 21 div .125 in neg rmoveto\n"
"} bind def\n"
"\n"
"/bit0 {\t \t\t% Draw a 0 bit of the POSTNET Barcode\n"
"  0 .05 in rlineto\n"
"  1 in 21 div .05 in neg rmoveto\n"
"} bind def  \n"
"\n"
"/dodigit {    \t\t% Do a complete digit of the barcode\n"
"  barcodebits exch get {\n"
"    2 mod 1 eq\n"
"      {bit1}\n"
"      {bit0}\n"
"    ifelse\n"
"    /BITS BITS 1 add def\n"
"    } forall\n"
"} def\n"
"\n"
"/barcode {\t\t% Do a complete barcode\n"
"  moveto \n"
"  gsave\n"
"    /CHECKSUM 0 def\n"
"    /BITS 0 def\n"
"    % More magic numbers to conform to USPS guidelines\n"
"    bit1\n"
"      {\n"
"      (0) 0 get sub dup dup 0 ge exch 9 le and {\n"
"        dup /CHECKSUM exch CHECKSUM add def\n"
"\tdodigit\n"
"\t} if\n"
"      } forall\n"
"    CHECKSUM 10 mod neg 10 add dup 10 eq {pop 0} if\n"
"    dodigit\n"
"    bit1\n"
"%   BITS 50 eq {.02 in setlinewidth stroke} if\n"
"% if you want 5 digit zip codes barcoded as well, make the previous line be\n"
"%   BITS 50 eq BITS 30 eq or {.02 in setlinewidth stroke} if\n"
"% I don't think it's a good idea to barcode a 5-digit zip.  Kinda defeats\n"
"% the purpose.\n"
"    BITS 50 eq BITS 30 eq or {.02 in setlinewidth stroke} if\n"
"  grestore\n"
"} def\n"
"/outline {\n"
"  newpath 0 0 moveto EWIDTH 0 rlineto 0 EHEIGHT rlineto\n"
"  EWIDTH neg 0 rlineto closepath \n"
"} def\n"
"% We transform so the lower left of the envelope is at (0,0).\n"
"% This may require adjustment for different printers.\n"
"/filostart {\t% start an envelope \n"
"  gsave\n"
"% --- printer-specific setup ---\n"
"% HP LaserJet and envelope MF left-adjusted.\n"
"%  2 mm EHEIGHT add 241 mm EWIDTH sub 38 mm add translate 90 rotate\n"
"% Apple LaserWriter II Select\n"
"  108 mm EHEIGHT 2 div add 277 mm EWIDTH sub translate 90 rotate\n"
"  XOFFSET YOFFSET translate\n"
"% ------------------------------\n"
"} def\n"
"/filostartkit {\t% start an envelope kit\n"
"  gsave\n"
"  EHEIGHT 1.5 mul 5 mm add 5.5 in EWIDTH 2 div sub translate 90 rotate\n"
"  newpath [1 mm] 0 setdash\n"
"    0 EHEIGHT moveto 5 mm EHEIGHT 2 div rlineto\n"
"    EWIDTH 10 mm sub 0 rlineto 5 mm EHEIGHT 2 div neg rlineto stroke\n"
"  newpath \n"
"    0 0 moveto 5 mm EHEIGHT 2 div neg rlineto\n"
"    EWIDTH 10 mm sub 0 rlineto 5 mm EHEIGHT 2 div rlineto stroke\n"
"  newpath \n"
"    0 0 moveto -10 mm 5 mm rlineto 0 EHEIGHT 10 mm sub rlineto\n"
"    10 mm 5 mm rlineto stroke\n"
"  newpath \n"
"    EWIDTH 0 moveto 10 mm 5 mm rlineto 0 EHEIGHT 10 mm sub rlineto\n"
"    -10 mm 5 mm rlineto stroke\n"
"  newpath [] 0 setdash\n"
"    outline stroke\n"
"} def\n"
"/filoend {\t% showpage and clean up\n"
"  showpage\n"
"  grestore\n"
"} def\n"
"/manualfeed {\t% Turn on manual feed\n"
"  languagelevel 2 ge {\n"
"    currentpagedevice /ManualFeed known {\n"
"      /newpagedevice 64 dict def\n"
"      currentpagedevice newpagedevice copy\n"
"        /ManualFeed true put\n"
"      newpagedevice setpagedevice\n"
"    } if\n"
"  } if\n"
"} def\n"
"%\n"
"% Entries for the PostScript directory.\n"
"%\n"
"/fontsize 7 def\n"
"/savep {currentpoint /y exch def /x exch def} def\n"
"/dcr {x y fontsize 1.1 mul sub moveto savep} def\n"
"/DirectoryEntry { % name fname\n"
"  savep x y fontsize sub moveto savep\n"
"  /Helvetica-Bold findfont fontsize scalefont setfont\n"
"  show\n"
"  /Helvetica findfont fontsize scalefont setfont\n"
"  (, ) show show dcr\n"
"} def\n"
"/Address { % s\n"
"  /Helvetica findfont fontsize scalefont setfont\n"
"  show dcr\n"
"} def\n"
"/Telephone { % s\n"
"  /Helvetica-Oblique findfont fontsize scalefont setfont\n"
"  savep show dcr\n"
"} def\n"
"/Email { % s\n"
"  /Helvetica findfont fontsize scalefont setfont\n"
"  savep (<) show\n"
"  /Courier findfont fontsize scalefont setfont\n"
"  show\n"
"  /Helvetica findfont fontsize scalefont setfont\n"
"  (>) show dcr\n"
"} def\n"
"end\n"
"%%EndResource\n"
"%%EndProlog\n"
"%%BeginSetup\n"
"filoDict begin\n"
"% We use a re-encoded font to get some special characters\n"
"% for European characters (see encoding above)\n"
"/Helvetica /filofont plusvec ReEncodeSmall\n"
"end\n"
"%%EndSetup\n"
