summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Resource/Init/pdf_ops.ps')
-rw-r--r--Resource/Init/pdf_ops.ps32
1 files changed, 21 insertions, 11 deletions
diff --git a/Resource/Init/pdf_ops.ps b/Resource/Init/pdf_ops.ps
index fe61b12d..27c20680 100644
--- a/Resource/Init/pdf_ops.ps
+++ b/Resource/Init/pdf_ops.ps
@@ -680,8 +680,8 @@ end
} def
/Dpop { //OPsaveDstack begin previous { def } forall end } def
-% colorspaces that don't require special overprint transparency handling
-/okOPcs mark /DeviceGray 0 /DeviceCMYK 1 /DeviceN 2 /Separation 3 .dicttomark def
+% colorspaces that require special overprint transparency handling
+/specialOPcs mark /DeviceGray 0 /DeviceCMYK 1 /DeviceN 2 /Separation 3 .dicttomark def
% Take care of pushing a transparency group if we need it for SMask or for Overprint..
% After pushing the group, we save the ca and CA and change them
@@ -696,11 +696,18 @@ end
//OPsaveDstack begin
//Dpush exec % push the current OPsaveDstack values into 'previous'
/SupportsDevn .special_op
- okOPcs currentcolorspace 0 get dup /Indexed eq {
+ specialOPcs currentcolorspace 0 get dup /Indexed eq {
pop currentcolorspace 1 get % use the base space
} if
known or {
- 1 index /stroke ne { .currentfilloverprint } { .currentstrokeoverprint } ifelse
+ dup /stroke ne {
+ .currentfilloverprint
+ 1 index dup /.fillstroke eq exch /.eofillstroke eq or {
+ .currentstrokeoverprint or
+ } if
+ } {
+ .currentstrokeoverprint
+ } ifelse
% Change BM to CompatibleOverprint if this has overprint true
dup /ChangeBM exch def
.currentblendmode dup /Normal eq exch /Compatible eq or
@@ -961,12 +968,12 @@ currentdict dup /Dpush .undef /Dpop .undef
n
} bind executeonly def
/b { closepath B* } bind executeonly def
-/n { end { currentpoint } stopped not { pop pop clip } if newpath } bind executeonly def
+/n { end .currentpoint_valid { clip } if newpath } bind executeonly def
end readonly def
/W { //Wdict begin } bind executeonly def
/W*dict 8 dict dup begin
Wdict { def } forall
-/n { end { currentpoint } stopped not { pop pop eoclip } if newpath } bind executeonly def
+/n { end .currentpoint_valid { eoclip } if newpath } bind executeonly def
end readonly def
/W* { //W*dict begin } bind executeonly def
% ---------------- Text control ---------------- %
@@ -1057,7 +1064,8 @@ end readonly def
/settextposition {
% Update the TextMatrix translation.
gsave TextSaveMatrix setmatrix
- {currentpoint} stopped not {
+ .currentpoint_valid {
+ currentpoint
.currenttextrise
sub
matrix .currenttextmatrix
@@ -1105,6 +1113,9 @@ end readonly def
} bind executeonly odef
/BT {
+ % Bug 703996 has a path defined before BT, then stroked afterwards
+ .currentpoint_valid { //false upath } { //null } ifelse
+ /BT_upath gput
//false /illegal_BT gput
currentdict /TextSaveMatrix known {
( **** Error: illegal nested BT operator detected.\n)
@@ -1153,10 +1164,8 @@ end readonly def
/clip_if_required {
.currenttextrenderingmode 4 ge
- {currentpoint} //.internalstopped exec
- {//false}
- {pop pop //true}
- ifelse and
+ .currentpoint_valid
+ and
{ .currentfilladjust2 0 dup .setfilladjust2 clip .setfilladjust2} if
newpath
} bind def
@@ -1183,6 +1192,7 @@ end readonly def
%% in a nested text block (inside a gsave).
currentdict /qTextSaveMatrix known not {
switch_to_normal_marking_ops
+ currentdict /BT_upath get dup //null eq { pop } { newpath uappend } ifelse
} if
} bind executeonly def