Skip to content

Commit

Permalink
suppress output of PS operator ':show' to prevent the creation of add…
Browse files Browse the repository at this point in the history
…itional graphic elements
  • Loading branch information
mgieseki committed Jun 20, 2014
1 parent de662b7 commit d865510
Showing 1 changed file with 42 additions and 41 deletions.
83 changes: 42 additions & 41 deletions src/psdefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,44 +40,45 @@ const char *PSInterpreter::PSDEFS =
"rcmd}put @SD/prpath{{2(moveto)prcmd}{2(lineto)prcmd}{6(curveto)prcmd}{0(closepat"
"h)prcmd}pathforall}put @SD/charpath{/@dodraw false store :charpath/@dodraw true "
"store}put @SD/show{@dodraw{dup :gsave currentpoint newpath moveto true charpath "
"eofill :grestore :show}if}put @SD/stroke{@dodraw{0(newpath)prcmd prpath 0(stroke"
")prcmd newpath}{:stroke}ifelse}put @SD/fill{@dodraw{0(newpath)prcmd prpath 0(fil"
"l)prcmd newpath}{:fill}ifelse}put @SD/eofill{@dodraw{0(newpath)prcmd prpath 0(eo"
"fill)prcmd newpath}{:eofill}ifelse}put @SD/clip{:clip 0(newpath)prcmd prpath 0(c"
"lip)prcmd}put @SD/eoclip{:eoclip 0(newpath)prcmd prpath 0(eoclip)prcmd}put @SD/b"
"op{pop pop}put/@rect{4 -2 roll moveto exch dup 0 rlineto exch 0 exch rlineto neg"
" 0 rlineto closepath}bind def/@rectcc{4 -2 roll moveto 2 copy 0 lt exch 0 lt xor"
"{dup 0 exch rlineto exch 0 rlineto neg 0 exch rlineto}{exch dup 0 rlineto exch 0"
" exch rlineto neg 0 rlineto}ifelse closepath}bind def @SD/rectclip{newpath dup t"
"ype/arraytype eq{aload length 4 idiv{@rectcc}repeat}{@rectcc}ifelse clip newpath"
"}put @SD/rectfill{gsave newpath dup type/arraytype eq{aload length 4 idiv{@rectc"
"c}repeat}{@rectcc}ifelse fill grestore}put @SD/rectstroke{gsave newpath dup type"
"/arraytype eq{aload length 4 idiv{@rect}repeat}{@rect}ifelse stroke grestore}put"
" false setglobal @SD readonly pop/initclip 0 defpr/sysexec{@SD exch get exec}def"
"/adddot{dup length 1 add string dup 0 46 put dup 3 -1 roll 1 exch putinterval}de"
"f/setlinewidth{dup/setlinewidth sysexec applyscalevals 1(setlinewidth)prcmd}def/"
"setlinecap 1 defpr/setlinejoin 1 defpr/setmiterlimit 1 defpr/setdash{mark 3 1 ro"
"ll 2 copy/setdash sysexec applyscalevals exch aload length 1 add -1 roll countto"
"mark(setdash)prcmd pop}def/setgstate{currentlinewidth 1(setlinewidth)prcmd curre"
"ntlinecap 1(setlinecap)prcmd currentlinejoin 1(setlinejoin)prcmd currentmiterlim"
"it 1(setmiterlimit)prcmd currentrgbcolor 3(setrgbcolor)prcmd 6 array currentmatr"
"ix aload pop 6(setmatrix)prcmd currentdash mark 3 1 roll exch aload length 1 add"
" -1 roll counttomark(setdash)prcmd pop}def/save{@UD begin/@saveID vmstatus pop p"
"op def end :save @saveID 1(save)prcmd}def/restore{:restore setgstate @UD/@saveID"
" known{@UD begin @saveID end}{0}ifelse 1(restore)prcmd}def/gsave 0 defpr/grestor"
"e{:grestore setgstate 0(grestore)prcmd}def/grestoreall{:grestoreall setstate 0(g"
"restoreall)prcmd}def/rotate{dup type/arraytype ne{dup 1(rotate)prcmd}if/rotate s"
"ysexec}def/scale{dup type/arraytype ne{2 copy 2(scale)prcmd}if/scale sysexec}def"
"/translate{dup type/arraytype ne{2 copy 2(translate)prcmd}if/translate sysexec}d"
"ef/setmatrix{dup/setmatrix sysexec aload pop 6(setmatrix)prcmd}def/initmatrix{ma"
"trix setmatrix}def/concat{matrix currentmatrix matrix concatmatrix setmatrix}def"
"/makepattern{gsave <</mx 3 -1 roll >> begin dup/XUID[1000000 @patcnt]put mx/make"
"pattern sysexec dup dup begin PatternType @patcnt BBox aload pop XStep YStep Pai"
"ntType mx aload pop 15(makepattern)prcmd newpath matrix setmatrix PaintProc 0 1("
"makepattern)prcmd end/@patcnt @patcnt 1 add store end grestore}def/setpattern{be"
"gin PatternType 1 eq{PaintType 1 eq{XUID aload pop exch pop 1}{:gsave[currentcol"
"orspace aload length -1 roll pop]setcolorspace/setcolor sysexec XUID aload pop e"
"xch pop currentrgbcolor :grestore 4}ifelse(setpattern)prcmd}{/setpattern sysexec"
"}ifelse end}def/setcolor{dup type/dicttype eq{setpattern}{/setcolor sysexec}ifel"
"se}def/setgray 1 defpr/setcmykcolor 4 defpr/sethsbcolor 3 defpr/setrgbcolor 3 de"
"fpr/.setopacityalpha{dup/.setopacityalpha sysexec 1(setopacityalpha)prcmd}def ";
"eofill :grestore/@dodraw false store :show/@dodraw true store}if}put @SD/stroke{"
"@dodraw{0(newpath)prcmd prpath 0(stroke)prcmd newpath}{:stroke}ifelse}put @SD/fi"
"ll{@dodraw{0(newpath)prcmd prpath 0(fill)prcmd newpath}{:fill}ifelse}put @SD/eof"
"ill{@dodraw{0(newpath)prcmd prpath 0(eofill)prcmd newpath}{:eofill}ifelse}put @S"
"D/clip{:clip 0(newpath)prcmd prpath 0(clip)prcmd}put @SD/eoclip{:eoclip 0(newpat"
"h)prcmd prpath 0(eoclip)prcmd}put @SD/bop{pop pop}put/@rect{4 -2 roll moveto exc"
"h dup 0 rlineto exch 0 exch rlineto neg 0 rlineto closepath}bind def/@rectcc{4 -"
"2 roll moveto 2 copy 0 lt exch 0 lt xor{dup 0 exch rlineto exch 0 rlineto neg 0 "
"exch rlineto}{exch dup 0 rlineto exch 0 exch rlineto neg 0 rlineto}ifelse closep"
"ath}bind def @SD/rectclip{newpath dup type/arraytype eq{aload length 4 idiv{@rec"
"tcc}repeat}{@rectcc}ifelse clip newpath}put @SD/rectfill{gsave newpath dup type/"
"arraytype eq{aload length 4 idiv{@rectcc}repeat}{@rectcc}ifelse fill grestore}pu"
"t @SD/rectstroke{gsave newpath dup type/arraytype eq{aload length 4 idiv{@rect}r"
"epeat}{@rect}ifelse stroke grestore}put false setglobal @SD readonly pop/initcli"
"p 0 defpr/sysexec{@SD exch get exec}def/adddot{dup length 1 add string dup 0 46 "
"put dup 3 -1 roll 1 exch putinterval}def/setlinewidth{dup/setlinewidth sysexec a"
"pplyscalevals 1(setlinewidth)prcmd}def/setlinecap 1 defpr/setlinejoin 1 defpr/se"
"tmiterlimit 1 defpr/setdash{mark 3 1 roll 2 copy/setdash sysexec applyscalevals "
"exch aload length 1 add -1 roll counttomark(setdash)prcmd pop}def/setgstate{curr"
"entlinewidth 1(setlinewidth)prcmd currentlinecap 1(setlinecap)prcmd currentlinej"
"oin 1(setlinejoin)prcmd currentmiterlimit 1(setmiterlimit)prcmd currentrgbcolor "
"3(setrgbcolor)prcmd 6 array currentmatrix aload pop 6(setmatrix)prcmd currentdas"
"h mark 3 1 roll exch aload length 1 add -1 roll counttomark(setdash)prcmd pop}de"
"f/save{@UD begin/@saveID vmstatus pop pop def end :save @saveID 1(save)prcmd}def"
"/restore{:restore setgstate @UD/@saveID known{@UD begin @saveID end}{0}ifelse 1("
"restore)prcmd}def/gsave 0 defpr/grestore{:grestore setgstate 0(grestore)prcmd}de"
"f/grestoreall{:grestoreall setstate 0(grestoreall)prcmd}def/rotate{dup type/arra"
"ytype ne{dup 1(rotate)prcmd}if/rotate sysexec}def/scale{dup type/arraytype ne{2 "
"copy 2(scale)prcmd}if/scale sysexec}def/translate{dup type/arraytype ne{2 copy 2"
"(translate)prcmd}if/translate sysexec}def/setmatrix{dup/setmatrix sysexec aload "
"pop 6(setmatrix)prcmd}def/initmatrix{matrix setmatrix}def/concat{matrix currentm"
"atrix matrix concatmatrix setmatrix}def/makepattern{gsave <</mx 3 -1 roll >> beg"
"in dup/XUID[1000000 @patcnt]put mx/makepattern sysexec dup dup begin PatternType"
" @patcnt BBox aload pop XStep YStep PaintType mx aload pop 15(makepattern)prcmd "
"newpath matrix setmatrix PaintProc 0 1(makepattern)prcmd end/@patcnt @patcnt 1 a"
"dd store end grestore}def/setpattern{begin PatternType 1 eq{PaintType 1 eq{XUID "
"aload pop exch pop 1}{:gsave[currentcolorspace aload length -1 roll pop]setcolor"
"space/setcolor sysexec XUID aload pop exch pop currentrgbcolor :grestore 4}ifels"
"e(setpattern)prcmd}{/setpattern sysexec}ifelse end}def/setcolor{dup type/dicttyp"
"e eq{setpattern}{/setcolor sysexec}ifelse}def/setgray 1 defpr/setcmykcolor 4 def"
"pr/sethsbcolor 3 defpr/setrgbcolor 3 defpr/.setopacityalpha{dup/.setopacityalpha"
" sysexec 1(setopacityalpha)prcmd}def ";

0 comments on commit d865510

Please sign in to comment.