home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1445 / cards.ps next >
Encoding:
Text File  |  1990-12-28  |  2.3 KB  |  79 lines

  1. %!PS
  2. % @(#) $Header: cards.ps,v 1.1 90/06/11 02:56:04 jef Exp $
  3. %
  4. % cards.ps - set up PostScript environment for fake IDs
  5. %
  6. % Copyright (C) 1990 by Jef Poskanzer.  All rights reserved.
  7. %
  8. % This file defines:
  9. %   cardwidth, cardheight - sizes the card should be drawn to
  10. %   cardmargin - card should leave this much space inside the above sizes
  11. %   cardstart - all cards must start off by calling this
  12. %   cardend - all cards must call this when they are through
  13. %   cardticks - draws cut-marks that line up with cardwidth and cardheight
  14.  
  15.  
  16. % The card is defined in terms of these nominal sizes.
  17. /cardwidth  3.125 in  def
  18. /cardheight  1.875 in  def
  19. /cardmargin  .05 in  def
  20.  
  21.  
  22. % Un-comment one of the following groups to set the desired size of the card.
  23.  
  24. % Wallet size.
  25. /actualwidth  cardwidth  def
  26. /actualheight  cardheight  def
  27.  
  28. % Shirt-pocket size.
  29. %/actualwidth  3.5 in  def
  30. %/actualheight  2.25 in  def
  31.  
  32. % Business-card size.
  33. %/actualwidth  3.5 in  def
  34. %/actualheight  2 in  def
  35.  
  36. % Economy size.
  37. %/actualwidth  6.5 in  def
  38. %/actualheight  4.5 in  def
  39.  
  40.  
  41. % Define arrangement of cards on the page.
  42.  
  43. /cardswide 2 def
  44. /cardshigh 4 def
  45. /cardslotwidth  pagewidth pagemargin 2 mul sub cardswide div  def
  46. /cardslotheight  pageheight pagemargin 2 mul sub cardshigh div    def
  47.  
  48. /cardslot 0 def
  49.  
  50. /cardstart {
  51.     cardslot  cardswide cardshigh mul  ge {
  52.     showpage
  53.     /cardslot 0 def
  54.     } if
  55.     gsave
  56.     cardslotwidth cardslot cardswide mod mul pagemargin add        % dx
  57.     cardslotheight cardslot cardswide idiv 1 add mul
  58.       pageheight pagemargin sub exch sub                % dx dy
  59.     translate
  60.     actualwidth cardwidth div  actualheight cardheight div  scale
  61. } def
  62.  
  63. /cardend {
  64.     grestore
  65.     /cardslot cardslot 1 add def
  66. } def
  67.  
  68. /cardtick  0.08 in  def
  69. /cardticks {
  70.     0 0 moveto  cardtick neg 0 rmoveto  cardtick neg 0 rlineto  stroke
  71.     0 0 moveto  0 cardtick neg rmoveto  0 cardtick neg rlineto  stroke
  72.     cardwidth 0 moveto  cardtick 0 rmoveto  cardtick 0 rlineto  stroke
  73.     cardwidth 0 moveto  0 cardtick neg rmoveto  0 cardtick neg rlineto  stroke
  74.     cardwidth cardheight moveto  cardtick 0 rmoveto  cardtick 0 rlineto  stroke
  75.     cardwidth cardheight moveto  0 cardtick rmoveto  0 cardtick rlineto  stroke
  76.     0 cardheight moveto  cardtick neg 0 rmoveto  cardtick neg 0 rlineto  stroke
  77.     0 cardheight moveto  0 cardtick rmoveto  0 cardtick rlineto  stroke
  78. } def
  79.