home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 6 / 06.iso / b / b323 / 1.img / BGI1.PAK / PREAMSLD.BGI < prev    next >
Encoding:
Text File  |  1992-02-12  |  15.4 KB  |  726 lines

  1. %*****************************************************************
  2. % File: preamsld.bgi
  3. % Postscript preamble file for BGI Postscript driver
  4. % (c) Copyright 1989 Borland International
  5. % Last Update: 04-25-91 (35mm-SLIDE VERSION)
  6. %*****************************************************************
  7. %%EndComments
  8.  
  9. save
  10.  
  11. statusdict /35mm known { 35mm } if
  12.  
  13. /dic 12 dict def
  14.  
  15. /RES
  16. {
  17.    dic begin
  18.    /cn exch def
  19.    /new exch def
  20.    /bf exch def
  21.  
  22.    /bd bf findfont def
  23.    /fo bd maxlength dict def
  24.  
  25.    bd
  26.    {
  27.      exch dup /FID ne
  28.      {
  29.        dup /Encoding eq
  30.        {
  31.      exch dup length array copy
  32.      fo 3 1 roll put
  33.        }
  34.        {
  35.      exch fo 3 1 roll put
  36.        }
  37.        ifelse
  38.      }
  39.      {
  40.        pop pop
  41.      }
  42.      ifelse
  43.    }
  44.    forall
  45.  
  46.    fo /FontName new put
  47.    cn aload pop
  48.  
  49.    cn length 2 idiv
  50.    {
  51.      fo /Encoding get 3 1 roll put
  52.    }
  53.    repeat
  54.  
  55.    new fo definefont pop
  56.    end
  57. } def
  58.  
  59. % 1-30-90
  60. /pcVector [
  61.  16#00 /circumflex 16#01 /grave 16#02 /dieresis 16#03 /tilde 16#04 /acute
  62.  16#05 /cedilla  16#06 /ring 16#07 /slash 16#08 /caron
  63.  16#80 /Ccedilla 16#81 /udieresis 16#82 /eacute 16#83 /acircumflex
  64.  16#84 /adieresis 16#85 /agrave 16#86 /aring 16#87 /ccedilla
  65.  16#88 /ecircumflex 16#89 /edieresis 16#8a /egrave 16#8b /idieresis
  66.  16#8c /icircumflex 16#8d /igrave 16#8e /Adieresis 16#8f /Aring
  67.  16#90 /Eacute 16#91 /ae 16#92 /AE 16#93 /ocircumflex
  68.  16#94 /odieresis 16#95 /ograve 16#96 /ucircumflex 16#97 /ugrave
  69.  16#98 /ydieresis 16#99 /Odieresis 16#9a /Udieresis 16#9b /oslash
  70.  16#9c /sterling 16#9d /Oslash 16#9f /florin 16#a0 /aacute
  71.  16#a1 /iacute 16#a2 /oacute 16#a3 /uacute 16#a4 /ntilde
  72.  16#a5 /Ntilde 16#a6 /ordfeminine 16#a7 /ordmasculine 16#a8 /questiondown
  73.  16#ad /exclamdown 16#ae /guillemotleft 16#af /guillemotright 16#b0 /space
  74.  16#b1 /space 16#b2 /space 16#b3 /space 16#b7 /idieresis
  75.  16#b9 /Agrave  16#ba /currency 16#bb /sterling 16#bc /Ecircumflex
  76.  16#bd /section 16#be /Acircumflex 16#bf /Egrave 16#c0 /yen
  77.  16#c2 /cent 16#c3 /Ugrave 16#c8 /atilde 16#cb /space
  78.  16#d1 /Icircumflex 16#d2 /atilde 16#d3 /otilde 16#d4 /scaron
  79.  16#d5 /zcaron 16#d6 /Ydieresis 16#da /Atilde   16#df /Ocircumflex
  80.  16#e0 /a 16#e1 /b 16#e2 /c 16#e3 /p 16#e4 /s
  81.  16#e5 /s 16#e6 /m 16#e7 /t 16#e9 /t
  82.  16#ea /o 16#eb /d 16#ec /i 16#ed /Oslash
  83.  16#ee /e 16#f0 /Aacute 16#f1 /germandbls
  84. ] def
  85. % end 1-30-90
  86.  
  87. /OP
  88. {
  89.   bgiFill 0 ne bgiRes 0 eq and bgiFill 1 eq or  % 1 = SolidFill
  90.   {
  91.     1 CurrentFill ne
  92.     {
  93.       level0
  94.     } if
  95.     bgiFillColor                  % stack: (color)
  96.     dup /CurrentColor exch def    % set color
  97.     bgiRes 1 eq
  98.     {
  99.       bgiGrayTable exch get setgray
  100.     }
  101.     {
  102.       setbgicolor
  103.     } ifelse
  104.   }{
  105.     % stack:  -
  106.     0 bgiFill eq                  % 0 = HollowFill
  107.     {
  108.     }{
  109.       bgiFill dup 15 gt
  110.       {
  111.         pop
  112.       }{
  113.         % stack:  bgiFill
  114.         dup bgiRes 0 ne exch 9 ne and
  115.         {
  116.           level0
  117.           bgiPatTable exch get
  118.           setpatterndict begin
  119.             /bstring exch def
  120.  
  121.             /onbits 0 def
  122.             /offbits 0 def
  123.  
  124.             %9.375 0 /spot load setscreen
  125.             18.75 0  /spot load setscreen
  126.  
  127.             {} settransfer
  128.             offbits offbits onbits add div
  129.           end
  130.           setgray
  131.         }{
  132.           pop
  133.           level0                  % for pattern 9
  134.           0.3 setgray
  135.         } ifelse
  136.       } ifelse
  137.     } ifelse
  138.   } ifelse
  139.  
  140.   /CurrentFill bgiFill def
  141.   newpath
  142. } bind def
  143.  
  144.  
  145. /toStack
  146. {
  147.   bgiMono
  148.   bgiFill
  149.   bgiColor
  150.   bgiFillColor
  151.   bgiSize
  152.   bgiFont
  153.   bgiAttrib
  154.   bgiOrient
  155.   bgiRes
  156.   x0Clip
  157.   y0Clip
  158.   x1Clip
  159.   y1Clip
  160. } def
  161.  
  162. /fromStack
  163. {
  164.   /y1Clip exch def
  165.   /x1Clip exch def
  166.   /y0Clip exch def
  167.   /x0Clip exch def
  168.   /bgiRes exch def
  169.   /bgiOrient exch def
  170.   /bgiAttrib exch def
  171.   /bgiFont exch def
  172.   /bgiSize exch def
  173.   /bgiFillColor exch def
  174.   /bgiColor exch def
  175.   /bgiFill exch def
  176.   /bgiMono exch def
  177. } def
  178.  
  179. /level0 {
  180.   toStack
  181.   Memory0 restore
  182.   fromStack
  183.  
  184.   /Memory0 save def
  185.  
  186.   newpath
  187.   x0Clip y0Clip moveto
  188.   x0Clip y1Clip lineto
  189.   x1Clip y1Clip lineto
  190.   x1Clip y0Clip lineto
  191.   closepath
  192.   clip
  193.   newpath
  194.  
  195.   /Memory1 save def
  196.   /CurrentFont -1 def
  197.   /CurrentColor 0 def
  198. } def
  199.  
  200. /CL {
  201.   closepath
  202.   dup 1 eq
  203.   { DO } if
  204.   dup 2 eq
  205.   { gsave
  206.       0 CurrentFill ne            % 0 = Hollow fill
  207.       {
  208.         fill
  209.       } if
  210.    grestore DO
  211.   } if
  212.   3 eq
  213.   {
  214.     0 CurrentFill ne              % 0 = Hollow fill
  215.     {
  216.       fill
  217.     } if
  218.   } if
  219.  
  220. } bind def
  221.  
  222. /DO                               % draw outline
  223. {
  224.   bgiMono false eq
  225.   {
  226.      % color printer
  227.      bgiColor setbgicolor
  228.  
  229.   }
  230.   {
  231.     0.0 setgray
  232.   } ifelse
  233.   stroke
  234. } def
  235.  
  236. /setpatterndict 18 dict def
  237.  
  238. /spot
  239. {
  240.     1 add 4 mul cvi
  241.     exch
  242.     1 add 4 mul cvi
  243.     /xbit exch def
  244.     /ybit exch def
  245.     bstring ybit xbit -3 bitshift add get
  246.     1 7 xbit 7 and sub bitshift
  247.  
  248.     and 0 ne
  249.  
  250.     { /onbits onbits 1 add def 1}
  251.     { /offbits offbits 1 add def 0}
  252.     ifelse
  253. } bind def
  254. /bgiFontTable
  255. [
  256.    [ /AvantGarde-Book -96 58 739]
  257.    [ /AvantGarde-BookOblique -96 58 739]
  258.    [ /AvantGarde-Demi -92 90 739]
  259.    [ /AvantGarde-DemiOblique -92 90 39]
  260.    [ /Bookman-Demi -121 106 725]
  261.    [ /Bookman-DemiItalic -106 106 732]
  262.    [ /Bookman-Light -125 60 717]
  263.    [ /Bookman-LightItalic -110 60 717]
  264.    [ /Courier -82 40 624]
  265.    [ /Courier-Bold -85 100 674]
  266.    [ /Courier-BoldOblique -85 100 674]
  267.    [ /Courier-Oblique -82 40 624]
  268.    [ /Helvetica -97 73 729]
  269.    [ /Helvetica-Bold -106 73 729]
  270.    [ /Helvetica-BoldOblique -106  105 729]
  271.    [ /Helvetica-Oblique -106 73 729]
  272.    [ /Helvetica-Narrow -97 73 729]
  273.    [ /Helvetica-Narrow-Bold -106 73 729]
  274.    [ /Helvetica-Narrow-BoldOblique -106 73 729]
  275.    [ /Helvetica-Narrow-Oblique -97 73 729]
  276.    [ /NewCenturySchlbk-Bold -103 106 737]
  277.    [ /NewCenturySchlbk-BoldItalic -102 54 737]
  278.    [ /NewCenturySchlbk-Italic -102 42 737]
  279.    [ /NewCenturySchlbk-Roman -103 61 737]
  280.    [ /Palatino-Bold -98 44 719]
  281.    [ /Palatino-BoldItalic -98 54 726]
  282.    [ /Palatino-Italic -138 50 733]
  283.    [ /Palatino-Roman -141 38 723]
  284.    [ /Symbol -98 54 720]
  285.    [ /Times-Bold -99 95 670]
  286.    [ /Times-BoldItalic -98 54 682]
  287.    [ /Times-Italic -96 48 684]
  288.    [ /Times-Roman -109 49 682]
  289.    [ /ZapfChancery-MediumItalic -120 50 678]
  290.    [ /ZapfDingbats -98 54 720]
  291. ] def
  292.  
  293. /bgiPatTable
  294. [
  295.    <0000000000000000>
  296.    <ffffffffffffffff>
  297.    <ffff0000ffff0000>
  298.    <0102040810204080>
  299.    <e0c183070e1c3870>
  300.    <f0783c1e0f87c3e1>
  301.    <a5d269b45a2d964b>
  302.    <ff888888ff888888>
  303.    <8142241818244281>
  304.    <cc33cc33cc33cc33>
  305.    <8000080080000800>
  306.    <8800220088002200>
  307.    <dd8b078edde870b8>
  308.    <dfdfdf00fbfbfb00>
  309.    <081c22c180010204>
  310.    <0001020400402010>
  311. ] def
  312.  
  313. /bgiGrayTable
  314. [ 1.00 0.11 0.59 0.70 0.30 0.41 0.40 1.00 0.50 0.40 0.73 0.80 0.53 0.60 0.93
  315.   0.00  ] def
  316.  
  317. /bgiColorTable
  318. [
  319.   [1 1 1]                         % bright white
  320.   [0 0 1]                         % blue
  321.   [0 1 0]                         % green
  322.   [0 1 1]                         % cyan
  323.   [1 0 0]                         % red
  324.   [1 0 1]                         % magenta
  325.   [0.67  0.33  0]                 % brown
  326.   [0.75 0.75 0.75]                % light gray (white)
  327.   [0.5 0.5 0.5]                   % dark gray
  328.   [0.33 0.33 1]                   % light blue
  329.   [0.33  1 0.33]                  % light green
  330.   [0.33 1 1]                      % light cyan
  331.   [1 0.33  0.33]                  % light red
  332.   [1 0.33  1]                     % light magenta
  333.   [1 1 0]                         % yellow
  334.   [0 0 0]                         % black
  335.   [0.75 0.75 0.75]                % light gray (color 7 on color printers)
  336. ] def
  337.  
  338. /MT /moveto load def
  339. /LT /lineto load def
  340. /CP /closepath load def
  341. /NP /newpath load def
  342. /SD /setdash load def
  343. /SG /setgray load def
  344. /TR /translate load def
  345. /LW /setlinewidth load def
  346.  
  347. /DL
  348. {
  349.   moveto
  350.   lineto
  351.   DO
  352. } bind def
  353.  
  354. /TW
  355. {
  356.   20 div exch 20 div exch moveto
  357.   20 div exch 20 div exch lineto
  358.   DO
  359. } bind def
  360.  
  361. /TB
  362. {
  363.   20 div 4 1 roll
  364.   20 div 4 1 roll
  365.   20 div 4 1 roll
  366.   20 div 4 1 roll
  367.   DB
  368. } bind def
  369.  
  370. /SC
  371. {
  372.   /y1Clip exch def
  373.   /x1Clip exch def
  374.   /y0Clip exch def
  375.   /x0Clip exch def
  376.   level0
  377. } bind def
  378.  
  379. /ellipsedict 12 dict def
  380. ellipsedict /mtrx matrix put
  381.  
  382. /SA                               % stack:  x y xrad yrad start delta
  383. {
  384. % add an arc to the current path
  385.   ellipsedict begin
  386.     /delta exch 60.0 div def
  387.     /startangle exch 60.0 div def
  388.     /yrad exch def
  389.     /xrad exch def
  390.     /y exch def
  391.     /x exch def
  392.  
  393.     /endangle startangle delta add def
  394.     /savematrix mtrx currentmatrix def
  395.     x y translate
  396.     xrad yrad scale
  397.     0 0 1
  398.     delta 0 gt
  399.     {startangle endangle arc }
  400.     {startangle endangle arcn}
  401.     ifelse
  402.     savematrix setmatrix
  403.   end
  404. } bind def
  405.  
  406. /DOARC                            % stack:  x y xrad yrad start end
  407. {
  408. % add an arc to the current path
  409.   ellipsedict begin
  410.     /endangle exch def
  411.     /startangle exch def
  412.  
  413.     bgiOrient 0 ne
  414.     { exch } if
  415.     /yrad exch def
  416.     /xrad exch def
  417.     /y exch def
  418.     /x exch def
  419.  
  420.     /savematrix mtrx currentmatrix def
  421.     x y translate
  422.     xrad yrad scale
  423.     0 0 1 startangle endangle arc
  424.     savematrix setmatrix
  425.   end
  426. } bind def
  427.  
  428. /FE                               % stack:  x y xrad yrad  for ellipse
  429. {
  430.   gsave
  431.     OP
  432.     0 360 DOARC
  433.     3 CL
  434.   grestore
  435.   DO
  436. } bind def
  437.  
  438.  
  439. /DB                               % stack:    x1 y1 x0 y0 color
  440. {
  441.   OP
  442.   /y0 exch def
  443.   /x0 exch def
  444.   /y1 exch def
  445.   /x1 exch def
  446.   newpath
  447.   x0 y0 moveto x0 y1 lineto x1 y1 lineto x1 y0 lineto
  448.   3 CL
  449. } bind def
  450.  
  451. /DF                               % stack: (attrib) (size) (font)
  452. {
  453.   /bgiFont exch def
  454.   % dup 6 eq {pop 7} if
  455.   /bgiSize exch def
  456.   /bgiAttrib exch def
  457. } bind def
  458.  
  459. /FP                               % stack: (fill #)
  460. {
  461.   dup 15 le
  462.   {
  463.     /bgiFill exch def
  464.   }{
  465.     pop
  466.   } ifelse
  467. } bind def
  468.  
  469. /CO {                             % stack: (color) (fill color)
  470.   dup 15 le
  471.   { /bgiFillColor exch def}
  472.   {pop} ifelse
  473.   dup 15 le
  474.   { /bgiColor exch def}
  475.   {pop} ifelse
  476. } bind def
  477.  
  478. /ST                               % start text
  479.                                   % stack: -
  480. {
  481.   CurrentSize bgiSize ne CurrentFont bgiFont ne or
  482.   {
  483.     currentpoint
  484.     toStack
  485.     Memory1 restore
  486.     fromStack
  487.     moveto
  488.  
  489.  
  490.     /Memory1 save def
  491.     /CurrentColor 0 def
  492.  
  493.     bgiFont dup /CurrentFont exch def
  494.  
  495. % 1-4-90  don't reencode Symbol or ZapfDingbats fonts;
  496.     dup dup 34 ne exch 28 ne and /bRES exch def
  497. % end 1-4-90
  498.  
  499.     dup dup 8 ge exch 15 le  and
  500.     {
  501.       dup 8 eq                    % courier
  502.       { 0.93 }
  503.       {
  504.         dup 9 eq                  % courier-bold
  505.         { 0.94 }
  506.         {
  507.             dup   11 eq           % courier-bolditalic (1.02 expansion)
  508.             {  0.95  }
  509.             {
  510.               dup 10 eq           % courier-italic
  511.               { 0.95 }
  512.               {
  513.               dup 12 eq           % helvetica
  514.               { 0.93 }
  515.               {
  516.                 dup 13 eq         % helvetica-bold
  517.                 { 0.96 }
  518.                 {
  519.                   dup 14 eq       % helvetica-bolditalic
  520.                   { 0.93 }
  521.                   {
  522.                     dup 15 eq     % helvetica-italic (1.02 expansion)
  523.                 {     0.96 }
  524.                 {
  525.                       1
  526.                 }     ifelse
  527.                   } ifelse
  528.                 } ifelse
  529.               } ifelse
  530.               } ifelse
  531.           }   ifelse
  532.         } ifelse
  533.       } ifelse
  534.     }
  535.     {
  536.       dup 32 eq                   % times-roman
  537.       { 1 }
  538.       {
  539.         dup 29 eq                 % times-bold (1.02 expansion)
  540.         { 0.95 }
  541.         {
  542.           dup 30 eq               % times-boldoblique
  543.           { 0.91 }
  544.           {
  545.             dup 31 eq             % times-italic
  546.             { 0.92 }
  547.             {
  548.               1                   % everything else
  549.             } ifelse
  550.           } ifelse
  551.         } ifelse
  552.       } ifelse
  553.     } ifelse
  554.     /CurrentCompress exch  def
  555.  
  556.     bgiFontTable exch get         % stack: [(font name) offset thick]
  557.     dup 0 get                     % stack: array fontname
  558.     exch
  559.     dup 1 get
  560.     /CurrentUnderlineOffset exch def
  561.     dup 2 get
  562.     /CurrentUnderlineThickness exch def
  563.     3 get
  564.     /CurrentAscender exch bgiSize mul 1000.0 div def
  565. % 1-4-89
  566.     bRES
  567.     {
  568.       /thisFont pcVector RES /thisFont
  569.     } if
  570. % end 1-4-89
  571.     findfont
  572.  
  573.     bgiSize dup /CurrentSize exch def
  574.     scalefont setfont
  575.   } if
  576.  
  577. % set the text color or gray scale
  578.   bgiMono false eq
  579.   {
  580.     % color printer               stack:  color
  581.     setbgicolor
  582.   }
  583.   {
  584.     % mono printer
  585.     0 eq                          % stack:  color
  586.     { 1.0 setgray}
  587.     { 0.0 setgray}
  588.     ifelse
  589.   } ifelse
  590. } bind def
  591.  
  592. /setbgicolor
  593. {
  594.     dup 7 eq bgiMono not and
  595.     {
  596.       pop
  597.       16
  598.     } if
  599.  
  600.      bgiColorTable exch get       % stack:  [r g b]
  601.      dup
  602.      0 get                        % stack: [r g b] r
  603.      exch
  604.      dup
  605.      1 get                        % stack: r [rgb] g
  606.      exch
  607.      2 get                        % stack: r g b
  608.      setrgbcolor
  609. } bind def
  610.  
  611. /SH                               % stack:  string tdir rot justx justy
  612. {
  613.   /justy exch def
  614.   /justx exch def
  615.   90 mul /rot exch def
  616.  
  617.   0 ne                            %   tdir is on the stack
  618.                                   %   (this will move into driver)
  619.   {
  620.     /justx 2 def
  621.   } if
  622.  
  623.   dup stringwidth pop
  624.   CurrentCompress mul
  625.   /sx exch def
  626.   sx justx mul -0.5 mul
  627.   justy 0 eq
  628.   {
  629.     0                             % baseline aligned
  630.   }
  631.   {
  632.     justy 1 eq
  633.     {
  634.       CurrentAscender 2 div neg   % center aligned
  635.     }
  636.     {
  637.       CurrentAscender neg         % top aligned
  638.     } ifelse
  639.   } ifelse
  640.  
  641.   % underlining
  642.   gsave
  643.  
  644.   rot rotate rmoveto
  645.   bgiAttrib 4 and 0 ne            % true if underlined, false otherwise
  646.   {
  647.     currentpoint
  648.     CurrentUnderlineOffset CurrentSize mul 1000.0 div add
  649.     /yval exch def
  650.     /xval exch def
  651.  
  652.     bshow
  653.     xval yval moveto
  654.     sx xval add yval lineto
  655.     CurrentUnderlineThickness CurrentSize mul 1000.0 div setlinewidth
  656.     stroke
  657.   }
  658.   {
  659.     bshow
  660.   }
  661.   ifelse
  662.   grestore
  663. } bind def
  664.  
  665. /bshow
  666. {
  667.   CurrentCompress 1 eq
  668.   {
  669.     show
  670.   }
  671.   {
  672.     dup length /len exch def
  673.     len 0 ne
  674.     {
  675.        dup stringwidth pop /wid exch def
  676.        CurrentCompress wid mul    % (factor * wid)
  677.        wid sub                    % (factor * wid) - wid
  678.        len div                    % stack:  string per_char_amt
  679.        exch
  680.        0 exch
  681.        ashow
  682.     } if
  683.   } ifelse
  684. } bind def
  685.  
  686. /colorsetup
  687. {
  688.     % exchange colors 0 and 15
  689.     bgiColorTable 0 get           % stack:  [r g b]
  690.     bgiColorTable 15 get
  691.     exch
  692.     bgiColorTable 0 put
  693.     bgiColorTable 15 put
  694. } bind def
  695.  
  696. % ---- initialization
  697.  
  698. /CurrentFill 1 def
  699. /CurrentFont -1 def
  700. /CurrentSize -1 def
  701. /CurrentColor 15 def
  702.  
  703. /bgiMono 0 def
  704. /bgiFill 1 def
  705. /bgiColor 15 def
  706. /bgiFillColor 15 def
  707. /bgiSize 10 def
  708. /bgiFont 1 def
  709. /bgiOrient 0 def
  710. /bgiRes 1 def
  711. /bgiAttrib 0 def
  712.  
  713. 1.415 setmiterlimit
  714. 0.5 setlinewidth
  715.  
  716. .88 .88 scale                     % speeds up some interpreters
  717. 50 52 translate                   % center image in 35mm frame
  718. clippath 0 setgray fill           % fill background with black
  719.  
  720. /Memory0 save def
  721. /Memory1 save def
  722.  
  723. 0 0 moveto
  724.  
  725. %%EndProlog
  726.