📄 rfc1278.ps
字号:
%! 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% <holtz@cascade.carleton.cdn>% <holtz%cascade.carleton.cdn@ubc.csnet>% 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 dictionaryTeXDict 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.% NOTE: We use A4 size paper. For letter size paper the constants '340' in the% following code should be changed to '310'./@a4{72 Resolution div dup neg scale270 -3215 translateMtrx currentmatrix pop}def/@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 % A3 modes courtesy of Francis Pintos, UCL/@a3landscape{a3 initmatrix72 Resolution div dup neg scale-90 rotate300 310 translateMtrx currentmatrix popstatusdict begin 1 setpapertray end}def/@a3portrait{a3 initmatrix72 Resolution div dup neg scale300 310 translateMtrx currentmatrix popstatusdict begin 1 setpapertray end}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/@restore /restore load def/restore {vmstatus pop dup @VMused lt{pop @VMused}if % calculate virtual memory used exch pop exch @restore /@VMused exch def }def/@pri { ( ) print ( ) cvs print }def/@FontMatrix [1 0 0 -1 0 0] def/@FontBBox [0 0 1 1] def%%%%%%%%%%%%%%%%%%%% Procedure Defintions %%%%%%%%%%%%%%%%%%%%%%%%%%/@newfont % id @newfont - -- initialize a new font dictionary { /newname exch def newname 7 dict def % allocate new font dictionary newname load begin /FontType 3 def /FontMatrix @FontMatrix def /FontBBox @FontBBox 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 {save 3 1 roll exch /BitMaps get exch get /ch-data exch def ch-data null ne {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 restore } def/@sf % fontdict @sf - -- make that the current font { dup % All smallcaps fonts must have the string SmallCaps in their name /FontName known { dup /FontName get tempstring cvs (SmallCaps) search {/smallcaps true def pop pop pop} {/smallcaps false def pop} ifelse } {/smallcaps false def} ifelse setfont } 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/@pc % char-data ch @pc - -- print a character bitmap not downloaded {pop /ch-data exch def currentpoint translate ch-width ch-height true [1 0 0 -1 ch-xoff ch-yoff] {ch-image}imagemask }def/@bop0 % n @bop0 - -- begin the char def section of a new page { pop } def/@bop1 % n @bop1 - -- begin a brand new page { pop erasepage initgraphics Mtrx setmatrix /SaveImage save def%% RLW:% The following is a fix necessary since a /@beginspecial immediately% following a /@bop1 failed. This was due to a lack of definition of the% current point, something which can only happen in the one situation.% Suffer the extra code for all other case as new pages don't happen too often.% 0 0 moveto% } def/@eop % - @eop - -- end a page { showpage SaveImage restore } def/@start % - @start - -- start everything { @a4 % (there is not much to do) vmstatus pop /@VMused exch def pop } def/@end % - @end - -- done the whole shebang {(VM used: ) print @VMused @pri (. Unused: ) print vmstatus @VMused sub @pri pop pop (\n) print flush 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 { smallcaps {SmallCapShow} {show} ifelse } def/c % ch c - -- show the character (code given) { c-string exch 0 exch put c-string s } 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/l % x y l - -- draw line to { lineto } def/rl % dx dy rl - -- draw relative line { rlineto } def/rc % x0 y0 x1 y1 y2 y2 rc -- draw bezier curve { rcurveto } def/np % np - -- start a new path and save currenpoint { /SaveX currentpoint /SaveY exch def def % remember current point newpath } def/st % st - -- draw the last path and restore currentpoint { stroke SaveX SaveY moveto % restore the current point } def/f % f -- fill the last path and restore currentpoint { fill SaveX SaveY moveto % restore the current point } def/ellipse % xc yc xrad yrad startAngle endAngle ellipse { /endangle exch def /startangle exch def /yrad exch def /xrad exch def /y exch def /x exch def /savematrix matrix currentmatrix def x y translate xrad yrad scale 0 0 1 startangle endangle arc savematrix setmatrix } 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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -