summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlgs/Resource/Init/pdf_ops.ps
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlgs/Resource/Init/pdf_ops.ps')
-rw-r--r--Master/tlpkg/tlgs/Resource/Init/pdf_ops.ps109
1 files changed, 87 insertions, 22 deletions
diff --git a/Master/tlpkg/tlgs/Resource/Init/pdf_ops.ps b/Master/tlpkg/tlgs/Resource/Init/pdf_ops.ps
index fabef68a90a..589d0d5d927 100644
--- a/Master/tlpkg/tlgs/Resource/Init/pdf_ops.ps
+++ b/Master/tlpkg/tlgs/Resource/Init/pdf_ops.ps
@@ -1,4 +1,4 @@
-% Copyright (C) 2001-2012 Artifex Software, Inc.
+% Copyright (C) 2001-2018 Artifex Software, Inc.
% All Rights Reserved.
%
% This software is provided AS-IS with no warranty, either express or
@@ -9,8 +9,8 @@
% of the license contained in the file LICENSE in this distribution.
%
% Refer to licensing information at http://www.artifex.com or contact
-% Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
-% CA 94903, U.S.A., +1(415)492-9861, for further information.
+% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+% CA 94945, U.S.A., +1(415)492-9861, for further information.
%
% Definitions for most of the PDF operators.
@@ -291,8 +291,75 @@ currentdict /gput_always_allow .undef
/RG {/DeviceRGB .setstrokecolorspace .setstrokecolor} bdef
/k {/DeviceCMYK .setfillcolorspace .setfillcolor} bdef
/K {/DeviceCMYK .setstrokecolorspace .setstrokecolor} bdef
-/cs {dup dup type /nametype ne { 0 get } if //CSdict exch get exec exch .setfillcolorspace exec .setfillcolor} bdef
-/CS {dup dup type /nametype ne { 0 get } if //CSdict exch get exec exch .setstrokecolorspace exec .setstrokecolor} bdef
+/cs {dup dup type /nametype ne { 0 get } if
+ dup /ICCBased eq {
+ 1 index 1 get /OrigN .knownget not {1 index 1 get /N get} if mark
+ 4 2 roll
+ //CSdict exch get exec exch .setfillcolorspace exec {.setfillcolor} stopped
+ {
+ (error) == flush
+ cleartomark
+ [//null /DeviceGray //null /DeviceRGB /DeviceCMYK] exch
+ {get} stopped
+ {
+ ( **** Error: Unable to set an ICCBased colour space, and cannot set an alternate from the number of components.\n) print
+ /setcolorspace cvx /undefined signalerror
+ }
+ {
+ dup //null eq {
+ ( **** Error: Unable to set an ICCBased colour space, and cannot set an alternate from the number of components.\n) print
+ /setcolorspace cvx /undefined signalerror
+ }{
+ ICCProfileNError flush not {
+ ( **** Warning : Error setting an ICCBased colour space, using /N to set an alternate device space.\n) print
+ ( Output may be incorrect.\n) print
+ } if
+ setcolorspace
+ /ICCProfileNError where {/ICCProfileNError true put} if
+ } ifelse
+ }ifelse
+ }{
+ cleartomark pop
+ }
+ ifelse
+ } {
+ //CSdict exch get exec exch .setfillcolorspace exec .setfillcolor
+ } ifelse
+} bdef
+/CS {dup dup type /nametype ne { 0 get } if
+ dup /ICCBased eq {
+ 1 index 1 get /OrigN .knownget not {1 index 1 get /N get} if mark
+ 4 2 roll
+ //CSdict exch get exec exch .setstrokecolorspace exec {.setstrokecolor} stopped
+ {
+ cleartomark
+ [//null /DeviceGray //null /DeviceRGB /DeviceCMYK] exch
+ {get} stopped
+ {
+ ( **** Error: Unable to set an ICCBased colour space, and cannot set an alternate from the number of components.\n) print
+ /setcolorspace cvx /undefined signalerror
+ }
+ {
+ dup //null eq {
+ ( **** Error: Unable to set an ICCBased colour space, and cannot set an alternate from the number of components.\n) print
+ /setcolorspace cvx /undefined signalerror
+ }{
+ ICCProfileNError flush not {
+ ( **** Warning : Error setting an ICCBased colour space, using /N to set an alternate device space.\n) print
+ ( Output may be incorrect.\n) print
+ } if
+ setcolorspace
+ /ICCProfileNError where {/ICCProfileNError true put} if
+ } ifelse
+ }ifelse
+ }{
+ cleartomark pop
+ }
+ ifelse
+ } {
+ //CSdict exch get exec exch .setstrokecolorspace exec .setstrokecolor
+ } ifelse
+} bdef
/sc {.setfillcolor} bdef
/SC {.setstrokecolor} bdef
/sc* {.setfillcolor} bdef
@@ -409,19 +476,15 @@ currentdict /gput_always_allow .undef
% Establish a given color (and color space) as current.
/.settransparencyparams { % <alpha> <smask> .settransparencyparams -
PDFusingtransparency {
- /.begintransparencygroup where {
- pop .currentalphaisshape
- {
- 1 .setopacityalpha exch .setshapealpha 1
- } {
- 1 .setshapealpha exch .setopacityalpha 0
- } ifelse
- % Set the soft mask by rendering the XObject. Doing this every time
- % is obviously very inefficient; we'll improve it later.
- .settransparencymask
+ .currentalphaisshape
+ {
+ 1 .setopacityalpha exch .setshapealpha 1
} {
- pop pop
+ 1 .setshapealpha exch .setopacityalpha 0
} ifelse
+ % Set the soft mask by rendering the XObject. Doing this every time
+ % is obviously very inefficient; we'll improve it later.
+ .settransparencymask
} {
pop pop
} ifelse
@@ -1153,10 +1216,8 @@ end readonly def
} bdef
/Tf { % <font> <scale> Tf -
+ dup .setPDFfontsize
dup 0 eq {
- (\n **** Error: Invalid 0.0 font scale given for Tf\n)
- pdfformaterror
- ( Output may be incorrect.\n) pdfformaterror
pop 0.00000001 % handle invalid scale by using a really small value
} if
1 index type /dicttype ne {
@@ -1721,8 +1782,10 @@ end readonly def
% NB: We don't need clippath when filling or stroking
/tf {
+ .currentPDFfontsize 0 eq not {
//true /TextFillStateNeeded gput
settextfillstate //true TextTransSetup currentpoint fill TextTransTeardown moveto
+ } if
} bdef
/tn { currentpoint newpath moveto } bdef % Obsolete, never used.
% For stroking characters, temporarily restore the graphics CTM so that
@@ -1735,9 +1798,11 @@ end readonly def
settextfillstate //true TextTransSetup currentpoint fill TextTransTeardown moveto
}
{
- setstrokestate //true TextTransSetup
- currentpoint //Tmatrix currentmatrix TextSaveMatrix setmatrix .swapcolors stroke TextTransTeardown .swapcolors
- setmatrix moveto
+ .currentPDFfontsize 0 eq not {
+ setstrokestate //true TextTransSetup
+ currentpoint //Tmatrix currentmatrix TextSaveMatrix setmatrix .swapcolors stroke TextTransTeardown .swapcolors
+ setmatrix moveto
+ } if
} ifelse
//true /TextFillStateNeeded gput
} bdef