home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / postscri / 5587 < prev    next >
Encoding:
Text File  |  1992-11-17  |  6.9 KB  |  261 lines

  1. Newsgroups: comp.lang.postscript
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!haven.umd.edu!decuac!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!ryn.mro4.dec.com!mcis2.enet.dec.com!sherwin
  3. From: sherwin@mcis2.enet.dec.com (Jim Sherwin)
  4. Subject: Re: Labels for Video Tapes
  5. Message-ID: <1992Nov16.205839.28164@ryn.mro4.dec.com>
  6. Sender: news@ryn.mro4.dec.com (USENET News System)
  7. Organization: DEC -- Greater Marlboro Area Property Management
  8. References:   <13NOV199209530837@lheavx.gsfc.nasa.gov>
  9. Date: 16 NOV 92 15:55:38 EDT
  10. Lines: 249
  11.  
  12.  
  13. In article <13NOV199209530837@lheavx.gsfc.nasa.gov>, orlandini@lheavx.gsfc.nasa.gov (Mauro Orlandini) writes...
  14. >       I am wondering if there exists a PostScript program to create
  15. >       labels for Video Tapes. I know of such a file for audio cassettes,
  16. >       but I am not aware of something for videos.
  17.  
  18.     I pulled this from this news group about 18 months ago.
  19.  
  20. <<<<<<<<<<<<<<<  cut here ... dont forget to delete the tailer  >>>>>>>>>>>>>>>>
  21. %!PS-Adobe-1
  22. %%Creator: Jamie Zawinski <jwz@lucid.com>
  23. %%Title: video-tape.ps
  24. %%CreationDate: 1-mar-91
  25. %%
  26. %%  PostScript code to generate VHS video cassette labels.  Version 2.0.
  27. %%  Copyright (c) 1991 Jamie Zawinski <jwz@lucid.com>.  Comments welcome.
  28. %%
  29. %%  Permission granted for non-commercial use and distribution so long as
  30. %%  this notice of copyright remains intact.
  31. %%
  32. %%  There are examples of how to use this code at the end of this file.
  33. %%
  34. %%  I find that rubber cement works best for attaching these labels to
  35. %%  video cassettes.  A water-based glue or epoxy will cause the paper
  36. %%  to warp eventually.
  37. %%
  38. %%EndComments
  39.  
  40. % Set this to any (short) string you like.
  41. /ID (JWZ) def
  42. /side-font   /Helvetica-Bold def
  43. /top-font    /Helvetica-Bold def
  44. /header-font /Helvetica-Bold def
  45. /number-font /Helvetica-Bold def
  46.  
  47. % swap the values of FG and BG if you want black-on-white.
  48. /FG 1   def
  49. /MG 0.5 def
  50. /BG 0   def
  51.  
  52. /bdef { bind readonly def } bind readonly def
  53.  
  54. /box {
  55.   4 2 roll
  56.   newpath moveto
  57.     exch dup 0 rlineto
  58.     exch 0 exch neg rlineto
  59.     neg 0 rlineto
  60.   closepath
  61. } bdef
  62.  
  63. /rightshow
  64.  {dup stringwidth pop
  65.   neg 0 rmoveto
  66.   show } bdef
  67.  
  68. /centershow
  69.  {dup stringwidth pop
  70.   2 div neg 0 rmoveto
  71.   show } bdef
  72.  
  73. /inch { 72 mul } bdef
  74.  
  75. /internal-draw-side-label {
  76.   gsave
  77.     1 setlinejoin
  78.     MG setgray
  79.     0 0 5.75 inch 0.75 inch  box fill
  80.     0 setgray
  81.     0 0 5.75 inch  0.75 inch  box stroke
  82.     BG setgray
  83.     1 inch -0.1 inch  4.25 inch 0.55 inch box fill
  84.     0.1 inch -0.1 inch  0.25 inch 0.55 inch box fill
  85.     FG setgray
  86.     1 inch -0.1 inch  4.25 inch 0.55 inch box stroke
  87.     0.1 inch -0.1 inch  0.25 inch 0.55 inch box stroke
  88.     gsave
  89.       number-font findfont [21 0 0 18 0 0] makefont setfont
  90.       0.324 inch -0.375 inch moveto
  91.       90 rotate
  92.       dup stringwidth pop /sw exch def
  93.       sw 0.54 inch gt { 0.54 inch sw div 1 scale } if
  94.       centershow
  95.     grestore
  96. } bdef
  97.  
  98. /draw-side-label {
  99.   gsave
  100.     0 0 moveto
  101.     translate
  102.     internal-draw-side-label
  103.     /names exch def
  104.     /height 0.5 inch names length div def
  105.     side-font findfont [height 0.9 mul 0 0 height 0 0] makefont setfont
  106.     FG setgray
  107.     1.05 inch -0.1 inch height sub moveto
  108.     names {
  109.       dup type /arraytype eq
  110.       { dup 0 get gsave show grestore
  111.     1 get gsave 4.1 inch 0 rmoveto rightshow grestore }
  112.       { gsave show grestore }
  113.       ifelse
  114.       0 height neg rmoveto
  115.     } forall
  116.   grestore
  117. } bdef
  118.  
  119.  
  120. /internal-draw-top-label {
  121.   gsave
  122.      1 setlinejoin
  123.      MG setgray
  124.      0 0 3.1 inch 1.75 inch box fill
  125.      0 setgray 
  126.      0 0 3.1 inch 1.75 inch box stroke
  127.      BG setgray 
  128.      0.1 inch  -0.5 inch  2.9 inch  1.15 inch  box fill
  129.      0.1 inch  -0.1 inch  2.9 inch  0.3 inch   box fill
  130.      FG setgray
  131.      0.1 inch  -0.5 inch  2.9 inch  1.15 inch  box stroke
  132.      0.1 inch  -0.1 inch  2.9 inch  0.3 inch   box stroke
  133.  
  134.      header-font findfont [12 0 0 15 0 0] makefont setfont
  135.      0.2 inch -0.3 inch moveto   (Tape )show show
  136.      header-font findfont [8 0 0 15 0 0] makefont setfont
  137.      2.9 inch -0.3 inch moveto   ID rightshow
  138.   grestore
  139. } bdef
  140.  
  141. /draw-top-label {
  142.   gsave
  143.     0 0 moveto
  144.     translate
  145.     internal-draw-top-label
  146.     /names exch def
  147.     top-font findfont [9 0 0 10 0 0] makefont setfont
  148.     FG setgray
  149.     0.2 inch -0.5 inch 9 dup add sub moveto
  150.     names {
  151.       dup type /arraytype eq
  152.       { dup 0 get gsave show grestore
  153.     1 get gsave 2.7 inch 0 rmoveto rightshow grestore }
  154.       { gsave show grestore }
  155.       ifelse
  156.       0 -9 rmoveto
  157.     } forall
  158.   grestore
  159. } bdef
  160.  
  161. /flag false def
  162. /count 0 def
  163.  
  164. /showpage {
  165.   initgraphics
  166.   0 setgray
  167.   8 inch 0.25 inch moveto 90 rotate
  168.   /Helvetica findfont 6 scalefont setfont
  169.   (video-tape.ps, version 2.0 (c) 1991 Jamie Zawinski <jwz@lucid.com>) show
  170.   systemdict begin showpage end
  171. } bdef
  172.  
  173. /draw-label {
  174.   /names exch def
  175.   /number exch def
  176.   names number 0.5 inch
  177.     flag { 3.58 inch } { 1.02 inch } ifelse
  178.   names number
  179.     flag { 3.63 inch } { 0.5 inch } ifelse
  180.   2.8 inch
  181.   gsave draw-top-label grestore
  182.   gsave draw-side-label grestore
  183.   flag {
  184.     0 3.35 inch translate
  185.     /count count 1 add def
  186.     count 3 eq { showpage /count 0 def } if
  187.   } if
  188.   /flag flag not def
  189. } bdef
  190.  
  191. %%EndProlog
  192.  
  193. %% Examples.
  194.  
  195.  
  196. (006)    [[(DEFCON-4)                (0)]
  197.      [(Videodrome)                ()]
  198.      [(An American Werewolf in London)    ()]]
  199. draw-label
  200.  
  201. (008)    [(Birdy)
  202.      (Rosemary's Baby)
  203.      (Repo Man)
  204.      (How the Grinch Stole Christmas)]
  205. draw-label
  206.  
  207. (023)    [[(The Art of Noise Live)        (0)]
  208.      [(Duran Duran)                (1117)]
  209.      [(Depeche Mode Live in Hamburg)    (1880)]
  210.      [(The The: Infected)            (2548)]
  211.      [(Sugarcubes Live)            (3487)]
  212.      [(Siouxsie and the Banshees: Once Upon a Time)    ()]]
  213. draw-label
  214.  
  215. (028)    [[(The Thing)                (0)]
  216.      [(Attack of the Killer Tomatoes)    (1844)]
  217.      [(Time Bandits)            (2840)]
  218.      [(Max Headroom)            (3922)]
  219.      [()                    (4410)]]
  220. draw-label
  221.  
  222. (057)    [[(Someone to Watch Over Me)        (0:00)]
  223.      [(The Abyss)                (1:46)]
  224.      [(Internal Affairs)            (4:11)]
  225.      [()                    (6:04)]]
  226. draw-label
  227.  
  228. (002)    [(Logan's Run)
  229.      (The Terminator)
  230.      (The Hunger)
  231.      (New Twilight Zone: "Aqua Vita")]
  232. draw-label
  233.  
  234. (051)    [[(The Blob)                (0)]
  235.      [(Straight to Hell)            (1653)]
  236.      [(Legend)                (2679)]
  237.      [(The Company of Wolves)        (4:29)]]
  238. draw-label
  239.  
  240. (053)    [[(Tapeheads)                (0)]
  241.      [(Hellbound: Hellraiser 2)        (1:33)]
  242.      [(The Kiss)                (3:11)]
  243.      (Penn and Teller's Cruel Tricks)
  244.      [(  for Dear Friends)            (4:56)]]
  245. draw-label
  246.  
  247.  
  248. %%Trailer
  249. %
  250. % This line must always be at the end of the file to ensure 
  251. % that the last page is forced out even if it's not full.
  252. %
  253. count 0 eq not { showpage } if
  254. <<<<<<<<<<<<<<<  cut here  >>>>>>>>>>>>>>>>
  255.  <>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>
  256.  <> "When things are going well,   \    Jim Sherwin a.k.a.                  <>
  257.  <>  someone will inevitably        \   sherwin@mcis2.enet.dec.com         <>
  258.  <>  experiment detrimentally."      \  !decwrl!mcis2.enet.dec.com!sherwin <>
  259.  <>               Boyle's Second Law  \ sherwin%mcis2.enet@decwrl.dec.com  <>
  260.  <>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>
  261.