home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c496 / 3.img / INFOBNCH.WPK / INFOBNCH.PS < prev   
Encoding:
Text File  |  1991-08-20  |  7.5 KB  |  246 lines

  1. %!PS-Adobe-1.0
  2. %%Creator: Robin Walsh, Jim Randall, Gary Pianosi, and Jim Welch
  3. %%CreationDate: March, 1988 .. May 1990
  4. %%Title:InfoBench POSTSCRIPT DICTIONARY
  5. %%===========================================================
  6. %%Modified:     By:             Reason:
  7. %% 19 Jul 89    Gary Pianosi    change FontRatio from 10/12 to 1 to
  8. %%                              fix flattened 'o's
  9. %%  6 Jan 90    Gary Pianosi    lower superscripts; raise subscripts
  10. %%                              so that they don't collide
  11. %%  7 Jan 90    Gary Pianosi    defined procedure SetupPage to set up
  12. %%                              page based on # lines and width in chars
  13. %%  7 Mar 90    Jim Welch       modified SetupPage to take page dimensions
  14. %%                              and to not print within unprintable border
  15. %%  8 Feb 90    Gary Pianosi    added graphhead procedure
  16. %% 26 Mar 90    Gary Pianosi    revised graphhead procedure (no clipping)
  17. %%  2 May 90    Jim Welch       Add Foreign characters to fonts
  18.  
  19. %%.......PROCEDURE SECTION
  20. %%========================
  21.  
  22. /StartPage {
  23.     72 1000 div dup scale
  24.     PageLeft PageTop moveto
  25.     /TopInitialize false def
  26. }def
  27.  
  28. /column {
  29.     xfactor mul             % for calculating columns on the page.
  30. }def
  31.  
  32. /choosefont {                   % sets font---stack:  typeface
  33.     findfont FontMatrix makefont setfont
  34. }def
  35.  
  36. /newline {
  37.     TopInitialize { StartPage } if
  38.     PageLeft currentpoint exch pop Leading sub moveto
  39. }def
  40.  
  41. /position {                     % stack: column #
  42.     TopInitialize { StartPage } if
  43.     currentpoint exch pop exch column PageLeft add exch moveto
  44. }def
  45.  
  46. /page {
  47.     TopInitialize { StartPage } if
  48.     showpage
  49.     /TopInitialize true def
  50. }def
  51.  
  52.  
  53. %% PRINTING PROCEDURES          [note : string must be on the stack]
  54. %%====================
  55.  
  56. /graphhead {
  57.    % This procedure was taken from the WGML output for the :GRAPHIC. tag.
  58.    % And modified to take parms in char/line units instead of 1/1000".
  59.    % Also, do not clip graphic.
  60.    %    Usage:      [depth] [xoff] [yoff] [scale] graphhead
  61.    %    Stack:      scale       - expressed as a percentage
  62.    %                y-offset    - in lines (positive down)
  63.    %                x-offset    - in chars (positive right)
  64.    %                depth       - in lines
  65.    /@scale exch def                             % get parms off the stack
  66.    /@yoff exch Leading mul def                  % ... convert from lines
  67.    /@xoff exch xfactor mul def                  % ... convert from chars
  68.    /@depth exch Leading mul def                 % ... convert from lines
  69.    currentpoint Leading add                     % get coords of top left corner
  70.    /@y exch def /@x exch def                    % ... (move up to top of char)
  71.    1 setlinewidth /@clw currentlinewidth def    % set line width for 'stroke'
  72.    @x @xoff add dup @y @yoff sub moveto         % move to (x+xoff,y-yoff)
  73.    @y @yoff sub @depth sub translate            % xlate (x+xoff,y-yoff-depth)
  74.    10 @scale mul 72 div dup scale
  75. }def
  76.  
  77. /normal
  78.     {/Courier-Ib choosefont show} def
  79. /italics
  80.     {/Courier-Oblique-Ib choosefont show} def
  81. /light
  82.     {/Courier-Ib choosefont .4 setgray show 0 setgray} def
  83. /bold
  84.     {/Courier-Bold-Ib choosefont show} def
  85. /bolditalics
  86.     {/Courier-BoldOblique-Ib choosefont show} def
  87. /compress
  88.     {/Courier-Ib findfont
  89.      [.5 xscale mul 0 0 yscale 0 0] makefont setfont show} def
  90. /double
  91.     {/Courier-Ib findfont
  92.      [2 xscale mul 0 0 2 yscale mul 0 0] makefont setfont show} def
  93. /expand
  94.     {/Courier-Ib findfont
  95.      [2 xscale mul 0 0 yscale 0 0] makefont setfont show} def
  96. /subscript
  97.     {/Courier-Ib findfont
  98.      [xscale 0 0 .5 yscale mul 0 0] makefont setfont
  99.      0 yscale 10 div neg rmoveto show 0 yscale 10 div rmoveto} def
  100. /superscript
  101.     {/Courier-Ib findfont
  102.      [xscale 0 0 .5 yscale mul 0 0] makefont setfont
  103.      0 yscale 3 div rmoveto show 0 yscale 3 div neg rmoveto} def
  104. /uline
  105.   %
  106.   % Emit the appropriate number of underscore characters.  Restore the
  107.   % current point after doing so.
  108.   %
  109.   {
  110.     choosefont
  111.     gsave
  112.     dup length
  113.     { (_) show } repeat
  114.     grestore
  115.     show
  116.   } def
  117.  
  118. /underline
  119.     {/Courier-Ib uline} def
  120. /boldunderline
  121.     {/Courier-Bold-Ib uline} def
  122.  
  123. /IbChars[               % These characters are added to the Courier fonts.
  124.  8#200 /Ccedilla        % - they are encoded at positions normally found
  125.  8#201 /udieresis       %   in Code Page 437 (United States)
  126.  8#202 /eacute
  127.  8#203 /acircumflex
  128.  8#204 /adieresis
  129.  8#205 /agrave
  130.  8#206 /aring
  131.  8#207 /ccedilla
  132.  8#210 /ecircumflex
  133.  8#211 /edieresis
  134.  8#212 /egrave
  135.  8#213 /idieresis
  136.  8#214 /icircumflex
  137.  8#215 /igrave
  138.  8#216 /Adieresis
  139.  8#217 /Aring
  140.  8#220 /Eacute
  141.  8#221 /ae
  142.  8#222 /AE
  143.  8#223 /ocircumflex
  144.  8#224 /ograve
  145.  8#225 /odieresis
  146.  8#226 /ucircumflex
  147.  8#227 /uacute
  148.  8#230 /ydieresis
  149.  8#231 /Odieresis
  150.  8#232 /Udieresis
  151.  8#233 /cent
  152.  8#234 /sterling
  153.  8#235 /yen
  154.  8#237 /florin
  155.  8#240 /aacute
  156.  8#241 /iacute
  157.  8#242 /oacute
  158.  8#243 /uacute
  159.  8#244 /ntilde
  160.  8#245 /Ntilde
  161.  8#246 /ordfeminine
  162.  8#247 /ordmasculine
  163.  8#250 /questiondown
  164.  8#255 /exclamdown
  165.  8#256 /guillemotleft
  166.  8#257 /guillemotright
  167.  8#355 /oslash
  168.  8#371 /periodcentered
  169.  8#372 /bullet
  170. ]def
  171.  
  172. /reencsmalldict 12 dict def
  173. /SetIbFont
  174.     %
  175.     % Add characters to a font
  176.     %
  177. {   reencsmalldict begin
  178.         /newcodesandnames exch def
  179.         /newfontname exch def
  180.         /basefontname exch def
  181.         /basefontdict basefontname findfont def
  182.         /newfont 256 dict def
  183.         basefontdict
  184.         {   exch dup /FID ne
  185.             {   dup /Encoding eq
  186.                 {   exch dup length array copy
  187.                     newfont 3 1 roll put
  188.                 }
  189.                 {   exch newfont 3 1 roll put
  190.                 }
  191.                 ifelse
  192.             }
  193.             {   pop
  194.                 pop
  195.             }
  196.             ifelse
  197.         }
  198.         forall
  199.         newfont /FontName newfontname put
  200. %       128 1 255 { newfont exch /.notdef put } for
  201.         newcodesandnames aload pop
  202.         newcodesandnames length 2 idiv
  203.         { newfont /Encoding get 3 1 roll put } repeat
  204.         newfontname newfont definefont pop
  205.         end
  206. } def
  207.  
  208. /SetupPage {
  209.     %
  210.     % Set up the character scaling factors to get the desired number
  211.     % of lines (length) and characters (width) on a 8.5 x 11 page.
  212.     %
  213.     % Parms: page length (inches)
  214.     %        page width  (inches)
  215.     %        page length (# of lines)
  216.     %        page width  (# characters)
  217.     %
  218.     /WidthChars   exch def
  219.     /LengthLines  exch def
  220.     /WidthofPage  exch def
  221.     /LengthofPage exch def
  222.     /PageLength LengthofPage 1000 mul OffsetTop   sub OffsetBot  sub def
  223.     /PageWidth  WidthofPage  1000 mul OffsetRight sub OffsetLeft sub def
  224.     /FontRatio  1 def
  225.     /xfactor PageWidth WidthChars div def
  226.     /Leading PageLength LengthLines div def
  227.     /xscale xfactor 5 mul 3 div def
  228.     /yscale Leading FontRatio mul def
  229.     /FontMatrix [xscale 0 0 yscale 0 0] def
  230.     /PageLeft OffsetLeft def
  231.     /PageTop PageLength OffsetBot add Leading sub def
  232.     /TopInitialize true def
  233.     /Courier             /Courier-Ib             IbChars SetIbFont
  234.     /Courier-Bold        /Courier-Bold-Ib        IbChars SetIbFont
  235.     /Courier-Oblique     /Courier-Oblique-Ib     IbChars SetIbFont
  236.     /Courier-BoldOblique /Courier-BoldOblique-Ib IbChars SetIbFont
  237. }def
  238.  
  239. %%......STARTUP: use 8.5 x 11 page with 66 lines by 80 columns
  240. %%=============
  241.  
  242. /OffsetTop 200 def          % unprintable border
  243. /OffsetBot 200 def
  244. /OffsetLeft 200 def
  245. /OffsetRight 300 def
  246.