home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / postscri / 5556 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  5.5 KB

  1. Xref: sparky comp.lang.postscript:5556 rec.photo:19904
  2. Newsgroups: comp.lang.postscript,rec.photo
  3. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!rpi!newsserver.pixel.kodak.com!kodak!sunshine!thomas
  4. From: thomas@sunshine.Kodak.COM (Thomas Kinsman)
  5. Subject: EXPOSURE RECORD SHEET (PHOTOGRAPHY)
  6. Message-ID: <1992Nov16.214427.12439@kodak.kodak.com>
  7. Keywords: Photography, PostScript
  8. Sender: news@kodak.kodak.com
  9. Organization: Eastman Kodak Co., Rochester, NY
  10. Distribution: usa
  11. Date: Mon, 16 Nov 92 21:44:27 GMT
  12. Lines: 200
  13.  
  14. %!PS
  15. % This  PostScript program, while not nearly as complicated or as  interesting
  16. % as  the  stuff  my  brother cranks out, will produce a pretty chart which is
  17. % used to record pictures when bracketting exposures.  So, if you aren't  sure
  18. % exactly  which  F-Stop  to use, you try several, and write them down.  It is
  19. % also used for recording the subject of each photograph, in case  you  forget
  20. % who  or  what  you  have taken a picture of.  (Can you find the hawk in this
  21. % picture?...  I think it's THAT speck over there...)
  22. %
  23. % Any other ideas on how this could be improved?
  24. %
  25. %    Source code written by Thomas B. Kinsman., thomask@kodak.com
  26. %    Purpose:     Make table of for recording exposures and subjects.
  27. %    Headings, as strings:
  28. /str_head1 [ (PHOTO) (SHUTTER) (F) (SUBJECT) ] def
  29. /str_head2 [ (No.) (SPEED) (STOP) (DESCRIPTION) ] def
  30. /PhotosPerRoll 38 def
  31.  
  32. %    EVERYTHING FROM HERE DOWN SHOULD BE AUTOMATIC
  33. %
  34. %    Procedure to convert points to inches.
  35. %
  36. /inch { 72 mul } def
  37. %
  38. %    Global settings:
  39. %
  40. %/FontName    /Helvetica    def % font name for procedure names.
  41. %/FontName    /Helvetica-Bold def % font name for procedure names.
  42. /FontName    /Times-Bold    def % font name for procedure names.
  43. /SmFontSize     12         def % size for tape description.
  44. /FontSize    18        def % size used for FontName.
  45. /Leading     2            def % space between lines.
  46.  
  47. /ResetFont { FontName findfont FontSize scalefont setfont } def
  48. /SetFontSize { /FontSize exch def ResetFont } def
  49. /SideMargin    0.375 inch def        % space bet. left and text.
  50. /LM        SideMargin def        % space from left edge to start of text.
  51. /RM  8.5 inch SideMargin sub def    % RIGHT MARGIN
  52. /TM 10.5 inch def            % TOP MARGIN
  53. /BM  0.5 inch def
  54.  
  55.  
  56. %
  57. %    Procedure to go to next line.
  58. %
  59. /nl                    % Newline
  60. {
  61.     currentpoint exch pop        % Get current height from
  62.                     % bottom of page.
  63.     FontSize Leading add sub        % compute next line height.
  64.     LM exch            % SideMargin will be X location.
  65.     moveto
  66. } def
  67.  
  68.  
  69. % upline
  70. /ul                    % Used when printing stack    
  71. {
  72.     currentpoint exch pop        % Get current height from
  73.                     % bottom of page.
  74.     FontSize Leading add add        % compute next line height.
  75.     LM  exch            % LeftSize will be X location.
  76.     moveto
  77. } def
  78.  
  79.  
  80. /num_headings str_head1 length def
  81. /heading_widths num_headings array def
  82. /heading_starts num_headings 1 add array def
  83.  
  84.  
  85. /set_widths
  86. {
  87.     0 1 num_headings 1 sub        % set all widths of columns
  88.     {
  89.     dup dup                %stack: index index index
  90.     str_head1 exch get        %stack: index index str_head1[index]
  91.  
  92.     stringwidth pop (   ) stringwidth pop add    %stack: index index width1
  93.  
  94.     exch                 %stack: index width1 index
  95.     str_head2 exch get        %stack: index width1 str_head2[index]
  96.     stringwidth pop (   ) stringwidth pop add    %stack:    index width1 width2
  97.  
  98. %    ul
  99. %    (stack_check ) show ul
  100. %    (w2 =  ) show 20 string cvs show ul            % debugging
  101. %    (w1 =  ) show 20 string cvs show ul            % debugging
  102. %
  103.     dup                %stack:    index width1 width2 width2
  104.     3 -1 roll            %stack: index width2 width2 width1
  105.     dup                %stack: index width2 width2 width1 width1
  106.  
  107.     3 1 roll            %stack: index width2 width1 width2 width1
  108.  
  109.     lt
  110.     {
  111.         exch
  112.     } if                %stack: index maxwidth minwidth
  113.     pop                %stack: index maxwidth
  114.  
  115.     heading_widths            %stack: index maxwidth array
  116.     3 1 roll            %stack: array index  maxwidth
  117.     put
  118.     } for
  119.  
  120.     /totalwidth LM def
  121.     0 1 num_headings 1 sub            % set all widths of columns
  122.     {
  123.     dup                     %stack: index index
  124.  
  125.     heading_starts exch totalwidth put    %stack: index
  126.     heading_widths exch get            %stack: heading_widths[index]
  127.     totalwidth add /totalwidth exch def
  128.     } for
  129.     heading_starts num_headings totalwidth put    %last starting row location.
  130.  
  131. } def
  132.  
  133.  
  134. /show_heading
  135. {
  136. /head_array exch def
  137.  
  138.     0 1 num_headings 1 sub
  139.     {
  140.     dup heading_starts exch get    %stack:    index heading_starts[index]
  141.     currentpoint exch pop moveto
  142.     head_array exch get show
  143.     } for
  144. } def
  145.  
  146.  
  147. /show_columns
  148. {
  149.     currentpoint
  150.     newpath
  151.     0 1 num_headings 1 sub
  152.     {
  153.     heading_starts exch get    ( ) stringwidth pop sub dup
  154.     TM moveto
  155.     BM lineto
  156.     } for
  157.     RM TM moveto
  158.     RM BM lineto
  159.     stroke
  160.     moveto
  161. } def
  162.  
  163. /show_rows
  164. {
  165. /Currenty    currentpoint exch pop def
  166. /LineHeight    Currenty BM sub PhotosPerRoll 1 sub div def
  167. /LeftSide    heading_starts 0 get ( ) stringwidth pop sub def
  168. /RightSide    RM def
  169.  
  170.     % First line first...
  171.     newpath
  172.     LeftSide Currenty LineHeight add moveto
  173.     RightSide Currenty LineHeight add lineto
  174.     % Top Line
  175.     LeftSide TM moveto
  176.     RightSide TM lineto
  177.     stroke
  178.  
  179.     1 1 PhotosPerRoll
  180.     {
  181.     newpath
  182.     LeftSide Currenty moveto
  183.     RightSide Currenty lineto
  184.     stroke
  185.     
  186.     10 string cvs            %stack: (frame_number)
  187.     heading_starts 0 get Currenty Leading add moveto
  188.     show
  189.  
  190.     Currenty LineHeight sub /Currenty exch def
  191.     } for
  192. } def
  193.  
  194.  
  195. erasepage
  196. ResetFont
  197. set_widths
  198.  
  199. LM TM moveto nl
  200. str_head1 show_heading nl
  201. str_head2 show_heading nl
  202. show_columns
  203. show_rows
  204.  
  205. /Helvetica-Bold findfont 8 scalefont setfont
  206. /AuthorString (11/16/92  T. B. Kinsman) def
  207. RM AuthorString stringwidth pop sub BM 12 sub moveto
  208. AuthorString show
  209.  
  210. showpage
  211. --
  212. thomas@acadia.kodak.com    Voice: 716/477-2831(w)         Fax: 716/722-0160
  213. Thomas B. Kinsman, Eastman Kodak Co., Flr 3, Bldg 65, RL, Roch., NY 14650-1816
  214.