home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / business / printcar / printcar.exe / PrintCardDB / ransom.ps < prev    next >
Text File  |  2000-06-10  |  4KB  |  194 lines

  1. %!PS-Adobe
  2. %
  3. % Ransom note writer.  Version 1.00
  4. %
  5. % (C) Copyright 1992 Diomidis Spinellis.  All rights reserved.
  6. % You can use and copy this program as long as the notice above
  7. % remains intact.  Modified copies must be clearly marked as such.
  8. % Send comments, threats, corrections etc. to dds@doc.ic.ac.uk
  9. %
  10.  
  11. % Put here the ransom note you want
  12. % Use the | symbol to generate new lines.
  13. /note (${firstName}$ ${lastName}$|
  14. ${title}$|
  15. ${company}$|
  16. |
  17. ${address}$|
  18. ${state}$ ${zip}$ ${city}$|
  19. |
  20. ${phoneLabel1}$: ${phone1}$|
  21. ${phoneLabel2}$: ${phone2}$|
  22. ${phoneLabel3}$: ${phone3}$|
  23. ${phoneLabel4}$: ${phone4}$|
  24. ${phoneLabel5}$: ${phone5}$|
  25. ) def
  26.  
  27. % vertical and horisontal scale in percent
  28. true {
  29.     /scaleX ${scaleX}$ def
  30.     /scaleY ${scaleY}$ def
  31. }{
  32.     /scaleX 100 def
  33.     /scaleY 100 def
  34. } ifelse
  35.  
  36. % top margin position
  37. /top { pagesize exch pop 80 sub } def
  38. % Left margin position
  39. /left 60 def
  40. % Right margin position
  41. /right { pagesize pop 60 sub } def
  42. % Line advance
  43. /lineskip -23 def
  44.  
  45. % - pagesize - x y
  46. /pagesize {
  47.     currentpagedevice (PageSize) get
  48.     dup 0 get exch 1 get
  49. } def
  50.  
  51. % Print the string
  52. % string ransom -
  53. /ransom {
  54.     {chr ransomchar}
  55.     forall
  56. } def
  57.  
  58. % Convert a character code to a string
  59. % int chr string
  60. /chr {
  61.     ( ) dup 0 3 index put exch pop
  62. } def
  63.  
  64. % Draw a black filled box for the bounding box of the character
  65. % char box -
  66. /box {
  67.     gsave
  68.         gsave
  69.             true charpath pathbbox
  70.         grestore
  71.         1 add /ury exch def
  72.         1 add /urx exch def
  73.         1 sub /lly exch def
  74.         1 sub /llx exch def
  75.         newpath
  76.         llx lly moveto
  77.         urx lly lineto
  78.         urx ury lineto
  79.         llx ury lineto
  80.         closepath
  81.         0 setgray
  82.         fill
  83.     grestore
  84. } def
  85.  
  86. % Display a single ransom character
  87. % character ransomchar -
  88. /ransomchar {
  89.     dup (|) eq {
  90.         pop
  91.         crlf
  92.     } {
  93.         randfont 7 random 15 add scalefont setfont
  94.         dup
  95.         gsave
  96.             5 random rotate
  97.             3 random 1 sub 3 random 1 sub rmoveto
  98.             dup ( ) eq {
  99.                 [ {show} ]
  100.             } {
  101.             [
  102.                 { show }
  103.                 { show }
  104.                 { true charpath stroke }
  105.                 { true charpath 10 random 20 div setgray fill }
  106.                 { dup box 1 setgray show }
  107.             ]
  108.             } ifelse
  109.             randarray exec
  110.         grestore
  111.         stringwidth
  112.         pop 0 rmoveto
  113.         format
  114.     } ifelse
  115. } def
  116.  
  117. % Return a random value 0 <= r < int
  118. % int random int
  119. /random {
  120.     rand
  121.     exch
  122.     mod
  123. } def
  124.  
  125. % Return a random element from the array
  126. % array randarray any
  127. /randarray {
  128.     dup
  129.     length
  130.     random
  131.     get
  132. } def
  133.  
  134. % Return a random font
  135. % - randfont font
  136. /randfont {
  137.     [
  138.         /Times-Roman
  139.         /Times-Bold
  140.         /Times-Italic
  141.         /Times-BoldItalic
  142.         /Helvetica
  143.         /Helvetica-Bold
  144.         /Helevetica-Oblique
  145.         /Helevetica-BoldOblique
  146.         /Times-Roman
  147.         /Times-Bold
  148.         /Times-Italic
  149.         /Times-BoldItalic
  150.         /Helvetica
  151.         /Helvetica-Bold
  152.         /Helevetica-Oblique
  153.         /Helevetica-BoldOblique
  154.         /Courier
  155.         /Courier-Bold
  156.         /Courier-Oblique
  157.         /Courier-BoldOblique
  158.     ]
  159.     randarray
  160.     findfont
  161. } def
  162.  
  163. % Do a carriage return / line feed
  164. % - crlf -
  165. /crlf {
  166.     currentpoint exch pop
  167.     left exch moveto 0 lineskip rmoveto
  168. } def
  169.  
  170. % Move to a new line if we are at the end of it
  171. % - format -
  172. /format {
  173.     currentpoint
  174.     pop
  175.     right gt
  176.     {crlf}
  177.     if
  178. } def
  179.  
  180.  
  181. clear
  182. erasepage
  183. initmatrix
  184.  
  185. 0 top translate
  186.  
  187. % scale in persent
  188. scaleX 100 div scaleY 100 div scale
  189.  
  190. left 0 moveto
  191. note ransom
  192.  
  193. showpage
  194.