% Setup the default graphics state.
% (black; 1 pt. linewidth; miter join; butt-ends; solid)
/defaultGraphicsState {0 g 1 w 0 j 0 J [] 0 d} def
% Emulation of the rectangle operators for PostScript implementations
% which do not implement all Level 2 features. This is an INCOMPLETE
% emulation; only the "x y width height rect..." form is emulated. /*rf {gsave newpath re fill grestore} def /*rs {gsave newpath re stroke grestore} def /*rc {newpath re clip} def /rf /rectfill where {pop /rectfill}{/*rf} ifelse load def /rs /rectstroke where {pop /rectstroke}{/*rs} ifelse load def /rc /rectclip where {pop /rectclip}{/*rc} ifelse load def
% Emulation of the selectfont operator. This includes a 20% increase in % the fontsize which is necessary to get sizes similar to the Java fonts. /*sf {exch findfont exch dup type /arraytype eq {makefont}{scalefont} ifelse setfont} bind def /sf /selectfont where {pop {1.2 mul selectfont}}{{1.2 mul *sf}} ifelse def
% Special version of stroke which allows the dash pattern to continue % across path segments. (This may be needed for PostScript although % modern printers seem to do this correctly.) /vg&stroke { currentdash pop length 0 eq {stroke} { currentdash /vg&doffset exch def pop flattenpath {m vg&resetdash} {2 copy currentpoint 3 -1 roll sub dup mul 3 1 roll sub dup mul add sqrt 3 1 roll l currentdash 3 -1 roll add setdash} {} {h vg&resetdash} pathforall stroke vg&resetdash } ifelse } def /vg&resetdash {currentdash pop vg&doffset setdash} def
% set page orientation (usage: portrait or landscape) /portrait {/po true def} def /landscape {/po false def} def
% force natural size for image (usage: naturalsize) /naturalsize {/ftp false def} def
% resize image to fill page (usage: fittopage) /fittopage {/ftp true def} def
% set margins of the page (usage: <left><bottom><top><right> setmargins) /setmargins {/mr exch def /mt exch def /mb exch def /ml exch def} def
% set the graphic's size (usage: <width><height> setsize) /setsize {/gh exch def /gw exch def} def
% set the graphic's origin (usage: <x0><y0> setorigin) /setorigin {/gy exch def /gx exch def} def
% calculate image center /imagecenter {pw ml sub mr sub 2 div ml add ph mt sub mb sub 2 div mb add} def
% calculate the necessary scaling /imagescale {po {gw}{gh} ifelse pw ml sub mr sub div po {gh}{gw} ifelse ph mt sub mb sub div 2 copy lt {exch} if pop ftp not {1 2 copy lt {exch} if pop} if 1 exch div /sfactor exch def /gw gw sfactor mul def /gh gh sfactor mul def} def
% calculate image origin /imageorigin {pw ml sub mr sub 2 div ml add po {gw}{gh} ifelse 2 div sub ph mt sub mb sub 2 div mb add po {gh}{gw} ifelse 2 div po {add}{sub} ifelse} def
% calculate the clipping origin /cliporigin {pw ml sub mr sub 2 div ml add po {gw}{gh} ifelse 2 div sub floor ph mt sub mb sub 2 div mb add po {gh}{gw} ifelse 2 div sub floor} def
% Set the clipping region to the bounding box. /cliptobounds {cliporigin po {gw}{gh} ifelse 1 add po {gh}{gw} ifelse 1 add rc} def
% set the base transformation matrix (usage: setbasematrix) /setbasematrix {imageorigin translate po {0}{90} ifelse rotate sfactor sfactor neg scale /defaultmatrix matrix currentmatrix def} def
% The lower-right bias in drawing 1 pt. wide lines. /bias {q 0.5 0.5 translate} def /unbias {Q} def
% Draw a line. (x0 y0 x1 y1 line) /L {bias n m l S unbias} def
% Polyline primitive. /polyline {n m 1 exch 1 exch {pop currentfile token pop currentfile token pop l} for } def
% Draw an oval. (x y w h OVL) /OVL {matrix currentmatrix /smatrix exch def /height exch def /width exch def /yv exch def /xv exch def width 2 div xv add height 2 div yv add translate width currentlinewidth sub 2 div height currentlinewidth sub 2 div neg scale n 0 0 1 5 -2 roll arc smatrix setmatrix S} def
% Draw a filled oval. (x y w h FOVL) /FOVL {matrix currentmatrix /smatrix exch def /height exch def /width exch def /yv exch def /xv exch def width 2 div xv add height 2 div yv add translate width 2 div height 2 div neg scale n 0 0 m 0 0 1 5 -2 roll arc h smatrix setmatrix f} def
% Draw a rounded rectangle. (x y w h arcwidth archeight RREC) /RREC {matrix currentmatrix /smatrix exch def 2 div /ah exch def 2 div /aw exch def /height exch def /width exch def /yv exch def /xv exch def aw ah scale matrix currentmatrix /nmatrix exch def smatrix setmatrix n xv width add aw sub yv m nmatrix setmatrix currentpoint exch 1 add exch currentpoint 1 add exch 1 add exch 1 arct smatrix setmatrix xv width add yv height add ah sub l nmatrix setmatrix currentpoint 1 add currentpoint exch 1 sub exch 1 add 1 arct smatrix setmatrix xv aw add yv height add l nmatrix setmatrix currentpoint exch 1 sub exch currentpoint exch 1 sub exch 1 sub 1 arct smatrix setmatrix xv yv ah add l nmatrix setmatrix currentpoint 1 sub currentpoint exch 1 add exch 1 sub 1 arct smatrix setmatrix s} def
% Draw a filled rounded rectangle. (x y w h arcwidth archeight FRREC) /FRREC{matrix currentmatrix /smatrix exch def 2 div /ah exch def 2 div /aw exch def /height exch def /width exch def /yv exch def /xv exch def aw ah scale matrix currentmatrix /nmatrix exch def smatrix setmatrix n xv width add aw sub yv m nmatrix setmatrix currentpoint exch 1 add exch currentpoint 1 add exch 1 add exch 1 arct smatrix setmatrix xv width add yv height add ah sub l nmatrix setmatrix currentpoint 1 add currentpoint exch 1 sub exch 1 add 1 arct smatrix setmatrix xv aw add yv height add l nmatrix setmatrix currentpoint exch 1 sub exch currentpoint exch 1 sub exch 1 sub 1 arct smatrix setmatrix xv yv ah add l nmatrix setmatrix currentpoint 1 sub currentpoint exch 1 add exch 1 sub 1 arct smatrix setmatrix h f} def
% Draw a string. (string x y STR) /STR {q m 1 -1 scale recshow Q} def
% Define basic plot symbols. /xys {/siz exch def /yv exch def /xv exch def} def /hline {xys n xv siz 2. div sub yv m siz 0 rlineto S} def /vline {xys n xv yv siz 2. div sub m 0 siz rlineto S} def /plus {xys n xv yv siz 2. div sub m 0 siz rlineto xv siz 2. div sub yv m siz 0 rlineto S} def /dot {n 2. div 0 360 arc s} def /fdot {n 2. div 0 360 arc h f} def /box {xys n xv siz 2 sqrt div 2 div sub yv siz 2 sqrt div 2 div sub siz 2 sqrt div dup rs} def /fbox {xys n xv siz 2 sqrt div 2 div sub yv siz 2 sqrt div 2 div sub siz 2 sqrt div dup rf} def /tridn{xys n xv yv siz 3 sqrt div add m siz 2. div neg 3 sqrt 2. div siz mul neg rlineto siz 0 rlineto s} def /ftridn{xys n xv yv siz 3 sqrt div add m siz 2. div neg 3 sqrt 2. div siz mul neg rlineto siz 0 rlineto h f} def
% Symbols defined in terms of the others. /star {3 copy cross plus} def /cross {xys q xv yv translate 45 rotate 0 0 siz plus Q} def /diamond {xys q xv yv translate 45 rotate 0 0 siz box Q} def /fdiamond {xys q xv yv translate 45 rotate 0 0 siz fbox Q} def /triup {xys q xv yv translate 180 rotate 0 0 siz tridn Q} def /ftriup {xys q xv yv translate 180 rotate 0 0 siz ftridn Q} def
% Define the composite fonts used to print Unicode strings. % Undefine particular values in an encoding array. /vg&undef { {exch dup 3 -1 roll /.notdef put} forall } def /vg&redef { {3 -1 roll dup 4 2 roll put} forall } def
% usage: key encoding basefontname vg&newbasefont font /vg&newbasefont { findfont dup length dict copy begin currentdict /FID undef /Encoding exch def dup /FontName exch def currentdict end definefont } def
% Unicode arrows encoding (unicode codes \u2190-\u21ff) % Also includes those "Letterlike" unicode characters % which are available in the symbol font. (unicode codes \u2100-\u214f) /UCArrowsEncoding NullEncoding dup length array copy << 16#11 /Ifraktur 16#1c /Rfraktur 16#22 /trademarkserif 16#35 /aleph 16#90 /arrowleft 16#91 /arrowup 16#92 /arrowright 16#93 /arrowdown 16#94 /arrowboth 16#d0 /arrowdblleft 16#d1 /arrowdblup 16#d2 /arrowdblright 16#d3 /arrowdbldown 16#d4 /arrowdblboth >> vg&redef def
/ZapfDingbats findfont /Encoding get dup length array copy /UCDingbatsEncoding exch def 16#20 1 16#7f { dup 16#20 sub exch UCDingbatsEncoding exch get UCDingbatsEncoding 3 1 roll put } for 16#a0 1 16#ff { dup 16#40 sub exch UCDingbatsEncoding exch get UCDingbatsEncoding 3 1 roll put } for UCDingbatsEncoding [ 16#c0 1 16#ff {} for ] vg&undef [ 16#00 16#05 16#0a 16#0b 16#28 16#4c 16#4e 16#53 16#54 16#55 16#57 16#5f 16#60 16#68 16#69 16#6a 16#6b 16#6c 16#6d 16#6e 16#6f 16#70 16#71 16#72 16#73 16#74 16#75 16#95 16#96 16#97 16#b0 16#bf ] vg&undef pop
% Define the base fonts which don't change. /Undefined-UC NullEncoding /Helvetica vg&newbasefont pop /MathOps-UC UCMathOpsEncoding /Symbol vg&newbasefont pop /Arrows-UC UCArrowsEncoding /Symbol vg&newbasefont pop /Dingbats-UC UCDingbatsEncoding /ZapfDingbats vg&newbasefont pop
% This routine pops the first unicode character off of a string and returns % the remainder of the string, the character code of first character, % and a "true" if the string was non-zero length. % <string> popfirst <remaining string> <true> % <null string> popfirst <false> /popfirst { dup length 1 gt {dup 0 get /vg&fbyte exch def dup 1 get /vg&cbyte exch def dup length 2 sub 2 exch getinterval true} {pop false} ifelse } def
% This routine shows a single unicode character given the font and % character codes. % <font code> <char code> unicharshow -- /unicharshow { 2 string dup 0 5 -1 roll put dup 1 4 -1 roll put internalshow } def
% This is an internal routine to alternate between determining the % bounding box for stringsize and showing the string for recshow. % <string> internalshow -- /internalshow {show} def
% This is an internal routine to alternate between determining the % bounding box for stringsize and stroking various ornaments. % <string> internalstroke -- /internalstroke {S} def
% Sets up internalshow to use the null device to determine string size. % -- nullinternalshow -- /nullinternalshow {/internalshow {false charpath flattenpath pathbbox updatebbox} def} def
% Sets up internalstroke to use the null device to determine string size. % -- nullinternalstroke -- /nullinternalstroke { /internalstroke {flattenpath pathbbox updatebbox} def} def
% This routine tests to see if the character code matches the first % character of a string. % <char code> <string> testchar <char code> <true or false> /testchar {exch dup 3 -1 roll 0 get eq} def
% Raise the text baseline for superscripts. % -- raise -- /raise { 0 fontsize 2 div rmoveto /fontsize fontsize 2 mul 3 div def currentfont /FontName get fontsize sf } def
% Un-raise the text baseline for superscripts. % -- unraise -- /unraise { /fontsize fontsize 1.5 mul def 0 fontsize 2 div neg rmoveto } def
% Lower the text baseline for subscripts. % -- lower -- /lower { 0 fontsize 3 div neg rmoveto /fontsize fontsize 2 mul 3 div def currentfont /FontName get fontsize sf } def
% Un-lower the text baseline for subscripts. % -- unlower -- /unlower { /fontsize fontsize 1.5 mul def 0 fontsize 3 div rmoveto } def
% Compare the top two elements on the stack and leave only the % larger one. /maxval {2 copy gt {pop} {exch pop} ifelse} def
% Tokenize a string. Do not use the usual PostScript token because % parentheses will not be interpreted correctly because of rescanning % of the string. /vg&token {/vg&string exch def /vg&index -1 def /vg&level 0 def 0 2 vg&string length 2 sub { dup dup 1 add exch vg&string exch get 8 bitshift vg&string 3 -1 roll get or dup 16#f0fe eq {pop 1}{16#f0ff eq {-1}{0} ifelse} ifelse /vg&level exch vg&level add def vg&level 0 eq {/vg&index exch def exit} if pop } for vg&index 0 ge { vg&string vg&index 2 add dup vg&string length exch sub getinterval vg&index 2 gt {vg&string 2 vg&index 2 sub getinterval}{()} ifelse true} {false} ifelse } bind def
% Recursively show an unicode string. % <string> recshow -- /recshow { popfirst { % Test to see if this is a string attribute. vg&fbyte 16#f0 and 16#e0 eq { q
% Font style. currentfont dup /FontStyleBits known {/FontStyleBits get}{pop 0} ifelse vg&cbyte or vg&fontstyles exch get fontsize exch exec
vg&token pop recshow currentpoint Q m recshow } { vg&fbyte 16#F8 and 16#F0 eq {
% Superscript and/or subscript. vg&cbyte 16#00 eq { vg&token pop exch vg&token pop 3 -1 roll q raise recshow unraise currentpoint pop Q exch q lower recshow unlower currentpoint pop Q maxval currentpoint exch pop m recshow } if
% Strikeout. vg&cbyte 16#01 eq { vg&token pop currentpoint 3 -1 roll recshow q 0 J vg&underline vg&uthick w currentpoint 4 -2 roll fontsize 3 div add moveto fontsize 3 div add lineto internalstroke Q recshow} if
% Underline. vg&cbyte 16#02 eq { vg&token pop currentpoint 3 -1 roll recshow q 0 J vg&underline vg&uthick w currentpoint 4 -2 roll vg&uoffset add moveto vg&uoffset add lineto internalstroke Q recshow} if
% Dashed underline. vg&cbyte 16#03 eq { vg&token pop currentpoint 3 -1 roll recshow q 0 J [ vg&uthick 5 mul vg&uthick 2 mul] 0 d vg&underline vg&uthick w currentpoint 4 -2 roll vg&uoffset add moveto vg&uoffset add lineto internalstroke Q recshow} if
% Dotted underline. vg&cbyte 16#04 eq { vg&token pop currentpoint 3 -1 roll recshow q 1 J [ 0 vg&uthick 3 mul] 0 d vg&underline vg&uthick w currentpoint 4 -2 roll vg&uoffset add moveto vg&uoffset add lineto internalstroke Q recshow} if
% Thick underline. vg&cbyte 16#05 eq { vg&token pop currentpoint 3 -1 roll recshow q 0 J vg&underline vg&uthick 2 mul w currentpoint 4 -2 roll vg&uoffset vg&uthick 2 div sub add moveto vg&uoffset vg&uthick 2 div sub add lineto internalstroke Q recshow} if
% Gray thick underline. vg&cbyte 16#06 eq { vg&token pop currentpoint 3 -1 roll recshow q 0 J vg&underline vg&uthick 2 mul w 0.5 setgray currentpoint 4 -2 roll vg&uoffset vg&uthick 2 div sub add moveto vg&uoffset vg&uthick 2 div sub add lineto internalstroke Q recshow} if
% Overbar. vg&cbyte 16#07 eq { vg&token pop dup stringsize relative 4 1 roll pop pop exch 3 -1 roll recshow q 0 J vg&underline vg&uthick w vg&uoffset neg add dup currentpoint pop exch m l internalstroke Q recshow} if } { vg&fbyte vg&cbyte unicharshow recshow } ifelse } ifelse } if } def
% Get the underline position and thickness from the current font. /vg&underline {
currentfont dup /FontType get 0 eq {/FDepVector get 0 get} if dup dup /FontInfo known { /FontInfo get dup dup /UnderlinePosition known { /UnderlinePosition get /vg&uoffset exch def } { pop /vg&uoffset 0 def } ifelse dup /UnderlineThickness known { /UnderlineThickness get /vg&uthick exch def } { pop /vg&uthick 0 def } ifelse } { pop /vg&uoffset 0 def /vg&uthick 0 def } ifelse /FontMatrix get currentfont dup /FontType get 0 eq {/FontMatrix get matrix concatmatrix}{pop} ifelse dup 0 vg&uoffset 3 -1 roll transform /vg&uoffset exch def pop 0 vg&uthick 3 -1 roll transform /vg&uthick exch def pop } def
% Make a frame with the coordinates on the stack. % <llx> <lly> <urx> <ury> frame -- /frame {4 copy m 3 1 roll exch l 4 -2 roll l l h} def
% Resets the accumulated bounding box to a degenerate box at the % current point. % -- resetbbox -- /resetbbox { currentpoint 2 copy /bbury exch def /bburx exch def /bblly exch def /bbllx exch def } def
% Make the relative bounding box relative to the currentpoint. % <llx'> <lly'> <urx'> <ury'> inflate <llx> <lly> <urx> <ury> /inflate { 2 {fontsize 0.2 mul add 4 1 roll} repeat 2 {fontsize 0.2 mul sub 4 1 roll} repeat } def
% Make the relative bounding box relative to the currentpoint. % <llx'> <lly'> <urx'> <ury'> relative <llx> <lly> <urx> <ury> /relative { currentpoint 3 -1 roll add 3 1 roll add exch 4 2 roll currentpoint 3 -1 roll add 3 1 roll add exch 4 2 roll } def
% Returns the size of a string appropriate for recshow. % <string> stringsize <llx> <lly> <urx> <ury> /stringsize { pushbbox /internalshow load /internalstroke load 7 -1 roll q nulldevice 0 0 m nullinternalshow nullinternalstroke resetbbox recshow /internalstroke exch def /internalshow exch def pushbbox 8 -4 roll restorebbox Q } def
% Calculate values for string positioning. /calcval {4 copy 3 -1 roll sub /widy exch def sub neg /widx exch def pop pop /dy exch def /dx exch def} def
% Utilities to position a string. % First letter (U=upper, C=center, B=baseline, L=lower) % Second letter (L=left, C=center, R=right) /align [ {calcval dx neg widy dy add neg rmoveto} % UL {calcval dx neg widy 2 div dy add neg rmoveto} % CL {calcval dx neg 0 rmoveto} % BL {calcval dx neg dy neg rmoveto} % LL {calcval widx dx add neg widy dy add neg rmoveto} % UR {calcval widx dx add neg widy 2 div dy add neg rmoveto} % CR {calcval widx dx add neg 0 rmoveto} % BR {calcval widx dx add neg dy neg rmoveto} % LR {calcval widx 2 div dx add neg widy dy add neg rmoveto} % UC {calcval widx 2 div dx add neg widy 2 div dy add neg rmoveto} % CC {calcval widx 2 div dx add neg 0 rmoveto} % BC {calcval widx 2 div dx add neg dy neg rmoveto} % LC ] def
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.