📄 prolog.ps,v
字号:
head 1.14;access;symbols zero-five-zero:1.14 zero-four-seventeen:1.12 zero-four-ten:1.12 zero-four-nine:1.11 zero-four-eight:1.11 zero-four-five:1.11 zero-four-zero:1.10;locks neto:1.14;comment @% @;1.14date 98.11.15.16.42.48; author neto; state Exp;branches;next 1.13;1.13date 98.11.07.18.12.15; author neto; state Exp;branches;next 1.12;1.12date 98.08.23.21.36.50; author neto; state Exp;branches;next 1.11;1.11date 98.07.24.17.49.57; author neto; state Exp;branches;next 1.10;1.10date 97.10.11.14.40.30; author neto; state Exp;branches;next 1.9;1.9date 97.08.15.16.46.44; author neto; state Exp;branches;next 1.8;1.8date 97.02.10.21.59.42; author neto; state Exp;branches;next 1.7;1.7date 97.02.10.19.49.22; author neto; state Exp;branches;next 1.6;1.6date 97.02.10.19.34.55; author neto; state Exp;branches;next 1.5;1.5date 97.02.10.19.14.23; author neto; state Exp;branches;next 1.4;1.4date 97.02.10.19.05.50; author neto; state Exp;branches;next 1.3;1.3date 97.01.21.17.39.15; author david; state Exp;branches;next 1.2;1.2date 97.01.17.20.25.56; author neto; state Exp;branches;next 1.1;1.1date 97.01.17.20.14.38; author neto; state Exp;branches;next ;desc@Prolog for postscript output.@1.14log@Default eps size is 2.5 inches.Also, EPS form has a border drawn around it.@text@%!PS-Adobe-3.0%%Creator: David Neto, directly and indirectly%%BoundingBox: 54 90 612 730%%Pages: 1%%Page: 1 1%% The following is for EPS mode%%%BoundingBox: 0 0 180 180% % Written by David Neto (on his Linux machine, no less!)% Tue Aug 2 14:43:24 EDT 1994% Fri Nov 17 17:01:21 EST 1995% $Log: prolog.ps,v $% Revision 1.13 1998/11/07 18:12:15 neto% Split off EPS into a separate prolog.%% Revision 1.12 1998/08/23 21:36:50 neto% Comment now wraps around to the next line.%% Revision 1.11 1998/07/24 17:49:57 neto% Added /comment.% (This was in 0.4.0)%% Revision 1.10 1997/10/11 14:40:30 neto% Make drawing of number labels easily switchable.%% Revision 1.9 1997/08/15 16:46:44 neto% Added operator ue for printing edges from untransformed coordinates.%% Revision 1.8 1997/02/10 21:59:42 neto% Make the large display the default.%% Revision 1.7 1997/02/10 19:49:22 neto% Fixed up the DSC for ghostview.%% Revision 1.7 1997/02/10 19:49:22 neto% Fixed up the DSC for ghostview.%% Revision 1.6 1997/02/10 19:34:55 neto% Added a gsave at the beginning.%% Revision 1.5 1997/02/10 19:14:23 neto% Added ts which shows a dot at raw coordinates, transforming them% first.%% Revision 1.4 1997/02/10 19:05:50 neto% Made it more EPSF-friendly.%% The EPS file must end with "end grestore %EOF"gsave 100 dict begin % Create a local scope for a few definitions /drawnumberlabels false def/numberlabel 1 def/dotsize 1 def % 1 pt radius/size 7.75 72 mul def % 7.75 inch square bounding box/hoffset 8.5 72 mul size sub 2 div def/voffset 9 72 mul size sub def % Remember the title/rightmargin 7.5 72 mul def/leftmargin 1 72 mul def/fontheight 14 def % this can change/makeepsf { /dotsize .2 def /size 2.5 72 mul def /hoffset 0 def /voffset 0 def gsave % Draw a thin border 0 setlinewidth 0 0 moveto size 0 lineto size size lineto 0 size lineto closepath stroke grestore} def%makeepsf/x { % x -- scaledx xmin sub xoffset add maxrange div size mul hoffset add} def/y { % y -- scaledy ymin sub yoffset add maxrange div size mul voffset add} def/dot { % x y -- % Put a dot at this position dotsize 0 360 arc fill } def/circle { % x y -- % Put a circle at this position gsave 0 setlinewidth dotsize .5 add 0 360 arc stroke grestore} def/bigdot { % i -- 1 add dup % 1+i 1+i xs exch get exch % x 1+i ys exch get % x y % Put a big dot at this position 5 0 360 arc stroke % 5pt * scalingfactor radius} def/bigbigdot { % i -- 1 add dup % 1+i 1+i xs exch get exch % x 1+i ys exch get % x y % Put a big big dot at this position 7 0 360 arc stroke % 7pt * scalingfactor radius} def/label { % string i -- 1 add dup % s 1+i 1+i xs exch get exch % s x 1+i ys exch get % s x y moveto -45 rotate show 45 rotate} def/labelall { 0 1 N 1 sub { dup ( ) cvs exch label } for} def/shownode { % i x y -- y exch x exch dot pop} def% Draw a bounding box/boundingbox { % -- newpath xmin x ymin y moveto xmax x ymin y lineto xmax x ymax y lineto xmin x ymax y lineto closepath stroke} def/s { % i xcoord ycoord -- ys % i xcoord ycoord ys 3 index % i xcoord ycoord ys i 3 -1 roll % i xcoord ys i ycoord y % i xcoord ys i transformedy put % i xcoord x % i transformedx xs % i transformedx xs 3 1 roll % xs i transformedx put % } def/sfcs { % i xcoord ycoord -- s} def/ts { % raw-x raw-y -- % Draw dot at transformed x and y drawnumberlabels { % Should we draw labels too? y exch x exch 1 index 1 index dot gsave % /Helvetica 10 findfont scalefont setfont moveto numberlabel ( ) cvs ( ) show show /numberlabel numberlabel 1 add def grestore } { y exch x exch dot } ifelse} def/rawedge { % x1 y1 x2 y2 -- % draw an edgefrom finalx to finaly newpath moveto lineto stroke} def/ue { % ux1 uy1 ux2 uy2 -- % draw an edge from point (x1,y1) to (x2,y2) % The coordinates are given in untransformed versions. y 4 1 roll x 4 1 roll y 4 1 roll x 4 1 roll rawedge} def /edge { % i j -- /j exch 1 add def /i exch 1 add def xs i get ys i get xs j get ys j get rawedge} def/inedge { % i j -- gsave 8 setlinewidth 0.2 setgray edge grestore } def/outedge { % i j -- gsave 8 setlinewidth 0.8 setgray edge grestore } def/drawcities { 1 1 N { dup xs exch get exch ys exch get dot } for} def/Helvetica findfont 5 scalefont setfont/title { % string -- gsave 72 9.8 72 mul moveto /Helvetica findfont 24 scalefont setfont show grestore} def% Display the comment below the title, and wrap it too./comment { % string -- 1 dict begin /str exch def gsave 72 9.5 72 mul moveto /Helvetica findfont 14 scalefont setfont fontheight /fontheight 14 def str wrapshow /fontheight exch def grestore end} def% Wrap if beyond the right margin./maybewrap { % -- currentpoint exch rightmargin ge % ypos bool -- { fontheight sub leftmargin exch moveto } % Wrap to next line { pop } ifelse} def/wrapshow { % string -- 1 dict begin /onecharstr ( ) def % string -- { % char-value -- dup 32 eq { maybewrap } if % Wrap only on word boundaries. onecharstr exch 0 exch put % Stuff the character into a new string. onecharstr show % Then print it. } forall end} defnewpath% FILE-SPECIFIC HERE@1.13log@Split off EPS into a separate prolog.@text@d3 1a3 1%%BoundingBox: 54 90 612 720d7 3d14 3d66 1a66 1 /size 4 72 mul defd69 9@1.12log@Comment now wraps around to the next line.@text@d1 1a1 1%!PS-Adobe-3.0 EPSF-2.0d3 1a3 1%%%BoundingBox: 0 0 288 288a5 6% The following is 4x4 inch, for EPS%BoundingBox: 0 0 288 288% The following is 7.75x7.75 inch, with title%BoundingBox: 54 90 612 720% Draw a graph with N nodes% edges.d11 3@1.11log@Added /comment.(This was in 0.4.0)@text@d17 4d58 3d217 1a217 1 72 9.5 72 mul movetod222 38a259 6/comment { % string -- gsave 72 9.2 72 mul moveto /Helvetica findfont 14 scalefont setfont show grestore@1.10log@Make drawing of number labels easily switchable.@text@d17 3d212 7@1.9log@Added operator ue for printing edges from untransformed coordinates.@text@d3 1a3 1%%BoundingBox: 0 0 288 288d17 3d45 2d157 13a169 1 y exch x exch dot@1.8log@Make the large display the default.@text@d17 3d157 9@1.7log@Fixed up the DSC for ghostview.@text@d17 6d50 1a50 1makeepsf@1.6log@Added a gsave at the beginning.@text@a2 1% The following is 4x4 inchd4 5a8 1% The following is 7.75x7.75 with titlea9 1%%Pages: 1d17 3a26 1%%Page: 1 1@1.5log@Added ts which shows a dot at raw coordinates, transforming themfirst.@text@d2 1d15 4d24 4a27 140 dict begin % Create a local scope for a few definitions @1.4log@Made it more EPSF-friendly.@text@d13 4a16 1% $Log$d130 3@1.3log@Added rawedge facility.@text@d1 5a5 1%!PS-Adobe-3.0d13 1d22 8d128 1a128 1/rawedge { x1 y1 x2 y2 -- % draw an edgefrom finalx to finalyd130 1a130 1}@1.2log@Added a circle option.@text@d63 1a63 1/label { % s i --d115 3d122 3a124 4 newpath xs i get ys i get moveto xs j get ys j get lineto stroke@1.1log@Initial revision@text@d13 1d36 9a44 1 1 0 360 arc fill % 1pt d108 4@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -