home *** CD-ROM | disk | FTP | other *** search
- %!
- %%Title: (WSBugFix)
- %%Version: 1.1
- %%Copyright: ((C) OneVision GmbH, Regensburg All Rights Reserved)
-
- systemdict /nextimage known
- { currentpacking true setpacking
- /hardbind where
- {pop}
- { /isarray {type dup /arraytype eq exch /packedarraytype eq or} bind def
- /hardbind
- { dup xcheck exch mark exch
- { dup type /marktype eq
- {pop {mark} aload pop}
- { dup xcheck
- { dup type /nametype eq
- {dup where {exch get dup xcheck {dup isarray {{exec} aload pop} if} if} if}
- {dup isarray {hardbind} if}
- ifelse
- } if
- }
- ifelse
- } forall
- counttomark packedarray exch pop exch {cvx} if
- } bind def
- } ifelse
- %% there is a bug in the windowserver. It does not return the
- %% current pattern when the underlying colorspace is separation or indexed
- /_CurPatGstate 3 dict def
- _CurPatGstate begin
- /gsavelevel 0 def
- /stack 10 array def
- end
- /currentcolor
- { currentcolor
- currentcolorspace 0 get /Pattern eq
- { dup type /dicttype ne 1 index type /nulltype ne and
- {_CurPatGstate /stack get _CurPatGstate /gsavelevel get get}
- if
- } if
- } hardbind def
- /setcolor
- { currentcolorspace 0 get /Pattern eq
- {dup _CurPatGstate /stack get _CurPatGstate /gsavelevel get 3 -1 roll put}
- if
- setcolor
- } hardbind def
- /setpattern
- { currentcolorspace 0 get /Pattern ne {[/Pattern currentcolorspace] setcolorspace} if
- setcolor
- } hardbind def
- /gsave
- { gsave
- _CurPatGstate /stack get _CurPatGstate /gsavelevel get get
- _CurPatGstate /gsavelevel 2 copy get 1 add put
- _CurPatGstate /stack get length _CurPatGstate /gsavelevel get le
- { _CurPatGstate /stack get dup length 10 add array
- _CurPatGstate /stack 2 index put copy pop
- _CurPatGstate /stack get dup length 10 sub
- 10 {2 copy null put 1 add} repeat pop pop
- } if
- _CurPatGstate /stack get _CurPatGstate /gsavelevel get 3 -1 roll put
- } hardbind def
- /grestore
- { _CurPatGstate /gsavelevel 2 copy get dup 0 gt {1 sub} if put
- grestore
- } hardbind def
- %% second bug in the windowserver: nulldevice causes windowserver death
- %% when the current colorspace is a noncolored pattern
- /nulldevice
- { matrix currentmatrix 0 0 0 0 Nonretained window dup windowdeviceround termwindow setmatrix
- } hardbind def
- %% third bug in the windowserver: CCITTFax filters don't work and SubFileDecode has a limit of 65535
- /repairfilterbugsdict 2 dict def
- repairfilterbugsdict begin
- revision 125 lt {/CCITTFaxDecode {pop pop pop [500 string] cvx 0 () /SubFileDecode} hardbind def} if
- /SubFileDecode
- { 2 index 65535 gt
- { 4 2 roll
- 3 dict begin /datalenstr 20 string def /bufstr 500 string def
- /datalenstr load cvs pop /inputfile exch dup type /filetype ne {0 () /SubFileDecode filter} if def
- [ currentdict end
- { begin
- /bufstr load /datalenstr load cvi
- dup 2 index length lt {0 exch getinterval 0} {1 index length sub} ifelse
- /datalenstr load 0 1 2 index length 1 sub {0 3 copy put pop pop} for cvs pop
- dup length 0 gt {/inputfile load exch readstring pop} if
- end
- } /exec cvx
- ] cvx 0 4 -2 roll
- } if
- } hardbind def
- end
- /filter
- { repairfilterbugsdict 1 index known
- {repairfilterbugsdict 1 index get exec} if
- filter
- } hardbind def
- setpacking
- } if
-