%! for use by dvi2ps Version 2.00 % a start (Ha!) at a TeX mode for PostScript. % The following defines procedures assumed and used by program "dvi2ps" % and must be downloaded or sent as a header file for all TeX jobs. % By: Neal Holtz, Carleton University, Ottawa, Canada % % % June, 1985 % Last Modified: Aug 25/85 % oystr 12-Feb-1986 % Changed @dc macro to check for a badly formed bits in character % definitions. Can get a <> bit map if a character is not actually % in the font file. This is absolutely guaranteed to drive the % printer nuts - it will appear that you can no longer define a % new font, although the built-ins will still be there. % To convert this file into a downloaded file instead of a header % file, uncomment all of the lines beginning with %-% %-%0000000 % Server loop exit password %-%serverdict begin exitserver %-% systemdict /statusdict known %-% {statusdict begin 9 0 3 setsccinteractive /waittimeout 300 def end} %-% if /TeXDict 200 dict def % define a working dictionary TeXDict begin % start using it. % units are in "dots" (300/inch) /Resolution 300 def /Inch {Resolution mul} def % converts inches to internal units /Mtrx 6 array def %%%%%%%%%%%%%%%%%%%%% Page setup (user) options %%%%%%%%%%%%%%%%%%%%%%%% % dvi2ps will output coordinates in the TeX system ([0,0] 1" down and in % from top left, with y +ive downward). The default PostScript system % is [0,0] at bottom left, y +ive up. The Many Matrix Machinations in % the following code are an attempt to reconcile that. The intent is to % specify the scaling as 1 and have only translations in the matrix to % properly position the text. Caution: the default device matrices are % *not* the same in all PostScript devices; that should not matter in most % of the code below (except for lanscape mode -- in that, rotations of % -90 degrees resulted in the the rotation matrix [ e 1 ] % [ 1 e ] % where the "e"s were almost exactly but not quite unlike zeros. /@letter { letter initmatrix 72 Resolution div dup neg scale % set scaling to 1. 310 -3005 translate % move origin to top (these are not exactly 1" Mtrx currentmatrix pop % and -10" because margins aren't set exactly right) } def % note mode is like letter, except it uses less VM /@note { note initmatrix 72 Resolution div dup neg scale % set scaling to 1. 310 -3005 translate % move origin to top Mtrx currentmatrix pop } def /@landscape { letter initmatrix 72 Resolution div dup neg scale % set scaling to 1. % -90 rotate % it would be nice to be able to do this Mtrx currentmatrix 0 0.0 put % but instead we have to do things like this because what Mtrx 1 -1.0 put % should be zero terms aren't (and text comes out wobbly) Mtrx 2 1.0 put % Fie! This likely will not work on QMS printers Mtrx 3 0.0 put % (nor on others where the device matrix is not like Mtrx setmatrix % like it is on the LaserWriter). 300 310 translate % move origin to top Mtrx currentmatrix pop } def /@legal { legal initmatrix 72 Resolution div dup neg scale % set scaling to 1. 295 -3880 translate % move origin to top Mtrx currentmatrix pop } def /@manualfeed { statusdict /manualfeed true put } def % n @copies - set number of copies /@copies { /#copies exch def } def %%%%%%%%%%%%%%%%%%%% Procedure Defintions %%%%%%%%%%%%%%%%%%%%%%%%%% /@newfont % id @newfont - -- initialize a new font dictionary { /newname exch def pop newname 7 dict def % allocate new font dictionary newname load begin /FontType 3 def /FontMatrix [1 0 0 -1 0 0] def /FontBBox [0 0 1 1] def /BitMaps 128 array def /BuildChar {CharBuilder} def /Encoding 128 array def 0 1 127 {Encoding exch /.undef put} for end newname newname load definefont pop } def % the following is the only character builder we need. it looks up the % char data in the BitMaps array, and paints the character if possible. % char data -- a bitmap descriptor -- is an array of length 6, of % which the various slots are: /ch-image {ch-data 0 get} def % the hex string image /ch-width {ch-data 1 get} def % the number of pixels across /ch-height {ch-data 2 get} def % the number of pixels tall /ch-xoff {ch-data 3 get} def % number of pixels below origin /ch-yoff {ch-data 4 get} def % number of pixels to left of origin /ch-tfmw {ch-data 5 get} def % spacing to next character /CharBuilder % fontdict ch Charbuilder - -- image one character { /ch-code exch def % save the char code /font-dict exch def % and the font dict. /ch-data font-dict /BitMaps get ch-code get def % get the bitmap descriptor for char ch-data null eq not { ch-tfmw 0 ch-xoff neg ch-yoff neg ch-width ch-xoff sub ch-height ch-yoff sub setcachedevice ch-width ch-height true [1 0 0 1 ch-xoff ch-yoff] {ch-image} imagemask } if } def /@sf % fontdict @sf - -- make that the current font { setfont() pop } def % in the following, the font-cacheing mechanism requires that % a name unique in the particular font be generated /@dc % char-data ch @dc - -- define a new character bitmap in current font { /ch-code exch def % ++oystr 12-Feb-86++ dup 0 get length 2 lt { pop [ <00> 1 1 0 0 8.00 ] } % replace <> with null if % --oystr 12-Feb-86-- /ch-data exch def currentfont /BitMaps get ch-code ch-data put currentfont /Encoding get ch-code dup ( ) cvs cvn % generate a unique name simply from the character code put } def /@bop0 % n @bop0 - -- begin the char def section of a new page { } def /@bop1 % n @bop1 - -- begin a brand new page { pop erasepage initgraphics Mtrx setmatrix /SaveImage save def() pop } def /@eop % - @eop - -- end a page { showpage SaveImage restore() pop } def /@start % - @start - -- start everything { @letter % (there is not much to do) } def /@end % - @end - -- done the whole shebang { end } def /p % x y p - -- move to position { moveto } def /r % x r - -- move right { 0 rmoveto } def /s % string s - -- show the string { show } def /c % ch c - -- show the character (code given) { c-string exch 0 exch put c-string show } def /c-string ( ) def /ru % dx dy ru - -- set a rule (rectangle) { /dy exch neg def % because dy is height up from bottom /dx exch def /x currentpoint /y exch def def % remember current point newpath x y moveto dx 0 rlineto 0 dy rlineto dx neg 0 rlineto closepath fill x y moveto } def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% the \special command junk %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The structure of the PostScript produced by dvi2ps for \special is: % @beginspecial % - any number of @hsize, @hoffset, @hscale, etc., commands % @setspecial % - the users file of PostScript commands % @endspecial % The @beginspecial command recognizes whether the Macintosh Laserprep % has been loaded or not, and redfines some Mac commands if so. % The @setspecial handles the users shifting, scaling, clipping commands % The following are user settable options from the \special command. /@SpecialDefaults { /hs 8.5 Inch def /vs 11 Inch def /ho 0 def /vo 0 def /hsc 1 def /vsc 1 def /CLIP false def } def % d @hsize - specify a horizontal clipping dimension % these 2 are executed before the MacDraw initializations /@hsize {/hs exch def /CLIP true def} def /@vsize {/vs exch def /CLIP true def} def % d @hoffset - specify a shift for the drwgs /@hoffset {/ho exch def} def /@voffset {/vo excl def} def % s @hscale - set scale factor /@hscale {/hsc exch def} def /@vscale {/vsc exch def} def /@setclipper { hsc vsc scale CLIP { newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto closepath clip } if } def % this will be invoked as the result of a \special command (for the % inclusion of PostScript graphics). The basic idea is to change all % scaling and graphics back to defaults, but to shift the origin % to the current position on the page. Due to TeXnical difficulties, % we only set the y-origin. The x-origin is set at the left edge of % the page. /@beginspecial % - @beginspecial - -- enter special mode { gsave /SpecialSave save def % the following magic incantation establishes the current point as % the users origin, and reverts back to default scalings, rotations currentpoint transform initgraphics itransform translate @SpecialDefaults % setup default offsets, scales, sizes @MacSetUp % fix up Mac stuff } def /@setspecial % to setup user specified offsets, scales, sizes (for clipping) { MacDrwgs {md begin /pxt ho def /pyt vo neg def end} {ho vo translate @setclipper} ifelse } def /@endspecial % - @endspecial - -- leave special mode { SpecialSave restore grestore } def /MacDrwgs false def % will get set if we think the Mac LaserPrep file has been loaded % - @MacSetUp - turn-off/fix-up all the MacDraw stuff that might hurt us % we depend on 'psu' being the first procedure executed % by a Mac document. We redefine 'psu' to adjust page % translations, and to do all other the fixups required. % This stuff will not harm other included PS files /@MacSetUp { userdict /md known % if md is defined { userdict /md get type /dicttype eq % and if it is a dictionary { /MacDrwgs true def md begin % then redefine some stuff /psu % redfine psu to set origins, etc. /psu load % this procedure contains almost all the fixup code { /letter {} def % it is bad manners to execute the real /note {} def % versions of these (clears page image, etc.) /legal {} def statusdict /waittimeout 300 put /page {pop} def % no printing of pages /pyt vo neg def % x & y pixel translations /pxt ho def } concatprocs def /od % redefine od to set clipping region /od load { @setclipper } concatprocs def end } if } if } def % p1 p2 concatprocs p - concatenate procedures /concatprocs { /p2 exch cvlit def /p1 exch cvlit def /p p1 length p2 length add array def p 0 p1 putinterval p p1 length p2 putinterval p cvx } def end % revert to previous dictionary TeXDict begin @start %%Title: tt7.dvi %%Creator: dvi2ps %%EndProlog 1 @bop0 [ 1500 ] /cmtt8.1500 @newfont cmtt8.1500 @sf [<1FF01FF00380038003800380038003800380038003800380038003800380E38EE38EE38EFFFEFFFE> 16 20 -1 0 17.642] 84 @dc [ 16 20 -1 0 17.642] 72 @dc [ 16 20 -2 0 17.642] 73 @dc [ 16 20 -2 0 17.642] 83 @dc [<03E00FF81C3C381E780E700EF00EE000E000E000E000E000E000F00E700E781E381E1C3E0FFE03E6> 16 20 -1 0 17.642] 67 @dc [ 24 20 0 0 17.642] 77 @dc [ 16 20 -1 0 17.642] 69 @dc [<07B81FF83CF8387870787038F038E038E1FEE1FEE000E000E000F0387038703838783CF81FF80798> 16 20 -1 0 17.642] 71 @dc [ 16 20 -1 0 17.642] 80 @dc [<3FE07FF07070E038E038E038E038E038E038E038E038E038E038E038E038E038E03870707FF03FE0> 16 20 -2 0 17.642] 79 @dc [ 16 20 -1 0 17.642] 78 @dc [<0E38001E3C001F7C001B6C001B6C001B6C001B6C001B6C001B6C001BEC003BEE003BEE00380E00380E00380E00380E00380E 00380E00FE3F80FE3F80> 24 20 0 0 17.642] 87 @dc [ 16 20 -1 0 17.642] 82 @dc [ 16 20 -1 0 17.642] 65 @dc [ 16 20 -1 0 17.642] 70 @dc [ 1500 ] /cmtt10.1500 @newfont cmtt10.1500 @sf [<07FC000FFE0007FC0000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E0 0000E000E0E0E0E0E0E0E0E0E0E0E0E0FFFFE0FFFFE07FFFE0> 24 25 -1 0 21.793] 84 @dc [<7F1FC0FFBFE07F1FC01C07001C07001C07001C07001C07001C07001C07001C07001C07001FFF001FFF001FFF001C07001C07 001C07001C07001C07001C07001C07007F1FC0FFBFE07F1FC0> 24 25 -1 0 21.793] 72 @dc [ 16 25 -3 0 21.793] 73 @dc [ 24 25 -2 0 21.793] 83 @dc [<01F00007FC000FFE001F0F003C0780780380780380700380F00000E00000E00000E00000E00000E00000E00000E00000F000 007003807803807807803C07801F0F800FFF8007FF8001F180> 24 25 -2 0 21.793] 67 @dc [ 24 25 -1 0 21.793] 77 @dc [<7FFFE0FFFFE07FFFE01C00E01C00E01C00E01C00E01C00E01C00001C1C001C1C001FFC001FFC001FFC001C1C001C1C001C00 001C00001C01C01C01C01C01C01C01C07FFFC0FFFFC07FFFC0> 24 25 -1 0 21.793] 69 @dc [<7F0F00FF9F007F1F001C17001C37001C37001C37001C77001C77001C67001C67001CE7001CE7001CE7001CC7001CC7001DC7 001DC7001D87001D87001D87001D07007F1FC0FF3FE07E1FC0> 24 25 -1 0 21.793] 78 @dc [<7F0000FF80007F00001C00001C00001C00001C00001C00001C00001C00001FF8001FFE001FFF001C0F801C03801C03C01C01 C01C01C01C01C01C03C01C03801C0F807FFF00FFFE007FF800> 24 25 -1 0 21.793] 80 @dc [<1FFC003FFE007FFF00780F00F00780F00780E00380E00380E00380E00380E00380E00380E00380E00380E00380E00380E003 80E00380E00380E00380F00780780F007FFF003FFE001FFC00> 24 25 -2 0 21.793] 79 @dc [<0E0E000F1E000F1E001B1B0019130019B30019B30019B30019B30019B30019B30039B38039F38039F38038E3803803803803 803803803001807001C07001C07001C0FC07E0FE0FE0FC07E0> 24 25 -1 0 21.793] 87 @dc [<7F03C0FF87E07F0FF01C0E701C0E701C0E201C0E001C0E001C0E001C0E001C3E001FFC001FF8001FFC001C1E001C0F001C07 001C07001C07001C07001C0F001C1E007FFC00FFF8007FE000> 24 25 -1 0 21.793] 82 @dc [<7F1FC0FF1FE07F1FC01C07001C07001C07001FFF000FFE000FFE000E0E000E0E00071C00071C00071C00071C00071C000318 0003B80003B80003B80001B00001B00001F00001F00000E000> 24 25 -1 0 21.793] 65 @dc [ 24 25 -1 0 21.793] 70 @dc [ 1500 ] /cmtt12.1500 @newfont cmtt12.1500 @sf [<03FF8003FF8003FF800038000038000038000038000038000038000038000038000038000038000038000038000038000038 00003800003800003800003800003800003800E0380EE0380EE0380EE0380EFFFFFEFFFFFE7FFFFE> 24 30 -1 0 25.632] 84 @dc [ 24 30 -1 0 25.632] 72 @dc [ 24 30 -4 0 25.632] 73 @dc [ 24 30 -3 0 25.632] 83 @dc [<00FE0003FF8007FFC00F83E01E00F01C00703C0078780038700038700038F00000E00000E00000E00000E00000E00000E000 00E00000E00000F000007000387000387800383C00781C00781E00F80F83F807FFF803FFB800FE38> 24 30 -2 0 25.632] 67 @dc [<7F007F00FF80FF807F007F001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C1C1C001C1C1C001C3E 1C001C361C001C361C001C771C001C771C001C631C001CE39C001CE39C001CC19C001CC19C001DC1DC001DC1DC001D80DC00 1D80DC001D80DC007F007F00FF007F807E003F00> 32 30 0 0 25.632] 77 @dc [<0701C00F83E00F83E00D83600D83600D83600DC7600DC7600DC7601CC6701CC6701CEE701CEE701CEE701CEE701CEE701C7C 70387C3838003838003838003838003838003838003838003878003C70001CFE00FEFF01FEFE00FE> 24 30 -1 0 25.632] 87 @dc [ 24 30 -2 0 25.632] 69 @dc [<7FFFFCFFFFFC7FFFFC0E001C0E001C0E001C0E001C0E001C0E00000E00000E00000E00000E00000E00000E00000E00000E00 000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00007FE000FFF0007FE000> 24 30 -1 0 25.632] 76 @dc [<003800007C00007C00006C0000EE0000EE0000EE0000C60001C70001C70001C70001C7000383800383800383800383800701 C00701C00701C00701C00E00E00E00E00E00E01E00F01C00701C00701C0070FF01FEFF01FEFF01FE> 24 30 -1 0 25.632] 86 @dc [ 24 30 -2 0 25.632] 80 @dc [<0FFE003FFF807FFFC07C07C07001C0F001E0F001E0E000E0E000E0E000E0E000E0E000E0E000E0E000E0E000E0E000E0E000 E0E000E0E000E0E000E0E000E0E000E0E000E0E000E0F001E07001C07C07C07FFFC03FFF800FFE00> 24 30 -3 0 25.632] 79 @dc [ 24 30 -1 0 25.632] 78 @dc [ 24 30 -1 0 25.632] 82 @dc [<7F01FCFF83FE7F01FC1C00700E00E00E00E00E00E00E00E00FFFE007FFC007FFC00701C00701C00383800383800383800383 8001C70001C70001C70001C70000C60000C60000EE0000EE0000EE00006C00007C00007C00003800> 24 30 -1 0 25.632] 65 @dc [<7FE000FFE0007FE0000E00000E00000E00000E00000E00000E00000E00000E00000E03800E03800E03800FFF800FFF800FFF 800E03800E03800E03800E00000E00000E00000E001C0E001C0E001C0E001C7FFFFCFFFFFC7FFFFC> 24 30 -1 0 25.632] 70 @dc [ 1500 ] /cmr10.1500 @newfont cmr10.1500 @sf [ 16 27 -4 0 20.755] 49 @dc 1 @bop1 cmtt8.1500 @sf 83 42 p (THIS) s 18 r (IS) s 17 r (CMTT) s 18 r (EIGHT) s 18 r (POINTS) s 17 r (WRITTEN) s 18 r (IN) s 18 r (METAFONT) s cmtt10.1500 @sf 83 91 p (THIS) s 22 r (IS) s 22 r (CMTT) s 21 r (TEN) s 22 r (POINTS) s 22 r (WRITTEN) s 22 r (IN) s 22 r (METAFONT) s cmtt12.1500 @sf 83 141 p (THIS) s 26 r (IS) s 25 r (CMTT) s 26 r (TWELVE) s 26 r (POINTS) s 25 r (WRITTEN) s 26 r (IN) s 25 r (METAFONT) s cmr10.1500 @sf 965 2770 p 49 c @eop @end .