From e92598acb3a0a20ac8ff31928d84188de2360b7f Mon Sep 17 00:00:00 2001 From: Reinhard Kotucha Date: Fri, 10 May 2019 23:51:26 +0000 Subject: Upgrade gs-9.26 -> gs-9.27 git-svn-id: svn://tug.org/texlive/trunk@51079 c570f23f-e606-0410-a88d-b1316a301751 --- Master/source/ghostscript-9.26.tar.xz | Bin 33059724 -> 0 bytes Master/source/ghostscript-9.27.tar.xz | Bin 0 -> 33182608 bytes Master/tlpkg/tlgs/README.TEXLIVE | 2 +- Master/tlpkg/tlgs/Resource/CIDFont/ArtifexBullet | Bin 2659 -> 2659 bytes Master/tlpkg/tlgs/Resource/ColorSpace/DefaultCMYK | 2 +- Master/tlpkg/tlgs/Resource/ColorSpace/DefaultGray | 2 +- Master/tlpkg/tlgs/Resource/ColorSpace/DefaultRGB | 2 +- Master/tlpkg/tlgs/Resource/ColorSpace/TrivialCMYK | 2 +- Master/tlpkg/tlgs/Resource/ColorSpace/sGray | 2 +- Master/tlpkg/tlgs/Resource/ColorSpace/sRGB | 2 +- Master/tlpkg/tlgs/Resource/Decoding/FCO_Dingbats | 2 +- Master/tlpkg/tlgs/Resource/Decoding/FCO_Symbol | 2 +- Master/tlpkg/tlgs/Resource/Decoding/FCO_Unicode | 2 +- Master/tlpkg/tlgs/Resource/Decoding/FCO_Wingdings | 2 +- Master/tlpkg/tlgs/Resource/Decoding/Latin1 | 2 +- .../tlpkg/tlgs/Resource/Decoding/StandardEncoding | 2 +- Master/tlpkg/tlgs/Resource/Decoding/Unicode | 2 +- Master/tlpkg/tlgs/Resource/Encoding/CEEncoding | 2 +- Master/tlpkg/tlgs/Resource/Encoding/ExpertEncoding | 2 +- .../tlgs/Resource/Encoding/ExpertSubsetEncoding | 2 +- Master/tlpkg/tlgs/Resource/Encoding/NotDefEncoding | 2 +- Master/tlpkg/tlgs/Resource/Encoding/Wingdings | 2 +- Master/tlpkg/tlgs/Resource/Init/FCOfontmap-PCLPS2 | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_agl.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_btokn.ps | 48 +- Master/tlpkg/tlgs/Resource/Init/gs_cet.ps | 103 ++- Master/tlpkg/tlgs/Resource/Init/gs_cff.ps | 62 +- Master/tlpkg/tlgs/Resource/Init/gs_cidcm.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_ciddc.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_cidfm.ps | 4 +- Master/tlpkg/tlgs/Resource/Init/gs_cidfn.ps | 47 +- Master/tlpkg/tlgs/Resource/Init/gs_cidtt.ps | 4 +- Master/tlpkg/tlgs/Resource/Init/gs_cmap.ps | 10 +- Master/tlpkg/tlgs/Resource/Init/gs_cspace.ps | 78 +-- Master/tlpkg/tlgs/Resource/Init/gs_dbt_e.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_diskn.ps | 12 +- Master/tlpkg/tlgs/Resource/Init/gs_dpnxt.ps | 133 ---- Master/tlpkg/tlgs/Resource/Init/gs_dps.ps | 222 ------ Master/tlpkg/tlgs/Resource/Init/gs_dps1.ps | 28 +- Master/tlpkg/tlgs/Resource/Init/gs_dps2.ps | 36 +- Master/tlpkg/tlgs/Resource/Init/gs_dscp.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_epsf.ps | 63 +- Master/tlpkg/tlgs/Resource/Init/gs_fapi.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps | 6 +- Master/tlpkg/tlgs/Resource/Init/gs_fonts.ps | 462 +++++++------ Master/tlpkg/tlgs/Resource/Init/gs_frsd.ps | 4 +- Master/tlpkg/tlgs/Resource/Init/gs_icc.ps | 4 +- Master/tlpkg/tlgs/Resource/Init/gs_il1_e.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_img.ps | 117 ++-- Master/tlpkg/tlgs/Resource/Init/gs_init.ps | 764 ++++++++++++--------- Master/tlpkg/tlgs/Resource/Init/gs_l2img.ps | 183 ----- Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps | 178 +++-- Master/tlpkg/tlgs/Resource/Init/gs_ll3.ps | 89 +-- Master/tlpkg/tlgs/Resource/Init/gs_mex_e.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_mgl_e.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_mro_e.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_pdf_e.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_pdfwr.ps | 14 +- Master/tlpkg/tlgs/Resource/Init/gs_res.ps | 171 +++-- Master/tlpkg/tlgs/Resource/Init/gs_resmp.ps | 6 +- Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps | 688 +++++++++---------- Master/tlpkg/tlgs/Resource/Init/gs_statd.ps | 63 +- Master/tlpkg/tlgs/Resource/Init/gs_std_e.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_sym_e.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_trap.ps | 6 +- Master/tlpkg/tlgs/Resource/Init/gs_ttf.ps | 468 +++++++------ Master/tlpkg/tlgs/Resource/Init/gs_typ32.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_typ42.ps | 16 +- Master/tlpkg/tlgs/Resource/Init/gs_type1.ps | 103 +-- Master/tlpkg/tlgs/Resource/Init/gs_wan_e.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/pdf_base.ps | 65 +- Master/tlpkg/tlgs/Resource/Init/pdf_draw.ps | 253 ++++--- Master/tlpkg/tlgs/Resource/Init/pdf_font.ps | 43 +- Master/tlpkg/tlgs/Resource/Init/pdf_main.ps | 216 ++++-- Master/tlpkg/tlgs/Resource/Init/pdf_ops.ps | 53 +- Master/tlpkg/tlgs/Resource/Init/pdf_rbld.ps | 4 +- Master/tlpkg/tlgs/Resource/Init/pdf_sec.ps | 15 +- Master/tlpkg/tlgs/Resource/SubstCID/CNS1-WMode | 2 +- Master/tlpkg/tlgs/Resource/SubstCID/GB1-WMode | 2 +- Master/tlpkg/tlgs/Resource/SubstCID/Japan1-WMode | 2 +- Master/tlpkg/tlgs/Resource/SubstCID/Korea1-WMode | 2 +- Master/tlpkg/tlgs/bin/gsdll32.dll | Bin 8165888 -> 8219648 bytes Master/tlpkg/tlgs/bin/gsdll32.lib | Bin 8470 -> 8946 bytes Master/tlpkg/tlgs/bin/gswin32.exe | Bin 140800 -> 141312 bytes Master/tlpkg/tlgs/bin/gswin32c.exe | Bin 132096 -> 132608 bytes Master/tlpkg/tlgs/iccprofiles/a98.icc | Bin 0 -> 564 bytes Master/tlpkg/tlgs/iccprofiles/default_gray.icc | Bin 416 -> 2460 bytes Master/tlpkg/tlgs/iccprofiles/esrgb.icc | Bin 0 -> 12840 bytes Master/tlpkg/tlgs/iccprofiles/rommrgb.icc | Bin 0 -> 564 bytes Master/tlpkg/tlgs/iccprofiles/scrgb.icc | Bin 0 -> 552 bytes Master/tlpkg/tlgs/lib/align.ps | 2 +- Master/tlpkg/tlgs/lib/caption.ps | 2 +- Master/tlpkg/tlgs/lib/cid2code.ps | 2 +- Master/tlpkg/tlgs/lib/docie.ps | 2 +- Master/tlpkg/tlgs/lib/gs_ce_e.ps | 2 +- Master/tlpkg/tlgs/lib/gs_il2_e.ps | 2 +- Master/tlpkg/tlgs/lib/gs_kanji.ps | 2 +- Master/tlpkg/tlgs/lib/gs_ksb_e.ps | 2 +- Master/tlpkg/tlgs/lib/gs_lgo_e.ps | 2 +- Master/tlpkg/tlgs/lib/gs_lgx_e.ps | 2 +- Master/tlpkg/tlgs/lib/gs_wl1_e.ps | 2 +- Master/tlpkg/tlgs/lib/gs_wl2_e.ps | 2 +- Master/tlpkg/tlgs/lib/gs_wl5_e.ps | 2 +- Master/tlpkg/tlgs/lib/gslp.ps | 4 +- Master/tlpkg/tlgs/lib/gsnup.ps | 2 +- Master/tlpkg/tlgs/lib/image-qa.ps | 2 +- Master/tlpkg/tlgs/lib/jispaper.ps | 2 +- Master/tlpkg/tlgs/lib/lines.ps | 2 +- Master/tlpkg/tlgs/lib/mkcidfm.ps | 2 +- Master/tlpkg/tlgs/lib/pdf2dsc.ps | 19 +- Master/tlpkg/tlgs/lib/pf2afm.ps | 2 +- Master/tlpkg/tlgs/lib/pfbtopfa.ps | 4 +- Master/tlpkg/tlgs/lib/ppath.ps | 2 +- Master/tlpkg/tlgs/lib/pphs.ps | 4 +- Master/tlpkg/tlgs/lib/prfont.ps | 2 +- Master/tlpkg/tlgs/lib/printafm.ps | 4 +- Master/tlpkg/tlgs/lib/ps2ai.ps | 2 +- Master/tlpkg/tlgs/lib/ps2epsi.ps | 2 +- Master/tlpkg/tlgs/lib/rollconv.ps | 4 +- Master/tlpkg/tlgs/lib/stocht.ps | 2 +- Master/tlpkg/tlgs/lib/traceimg.ps | 2 +- Master/tlpkg/tlgs/lib/traceop.ps | 2 +- Master/tlpkg/tlgs/lib/uninfo.ps | 2 +- Master/tlpkg/tlgs/lib/viewcmyk.ps | 4 +- Master/tlpkg/tlgs/lib/viewgif.ps | 2 +- Master/tlpkg/tlgs/lib/viewmiff.ps | 2 +- Master/tlpkg/tlgs/lib/viewpbm.ps | 4 +- Master/tlpkg/tlgs/lib/viewpcx.ps | 4 +- Master/tlpkg/tlgs/lib/viewps2a.ps | 2 +- Master/tlpkg/tlgs/lib/viewraw.ps | 4 +- Master/tlpkg/tlgs/lib/viewrgb.ps | 4 +- Master/tlpkg/tlgs/lib/winmaps.ps | 2 +- Master/tlpkg/tlgs/lib/zeroline.ps | 2 +- 133 files changed, 2436 insertions(+), 2606 deletions(-) delete mode 100644 Master/source/ghostscript-9.26.tar.xz create mode 100644 Master/source/ghostscript-9.27.tar.xz delete mode 100644 Master/tlpkg/tlgs/Resource/Init/gs_dpnxt.ps delete mode 100644 Master/tlpkg/tlgs/Resource/Init/gs_dps.ps delete mode 100644 Master/tlpkg/tlgs/Resource/Init/gs_l2img.ps create mode 100644 Master/tlpkg/tlgs/iccprofiles/a98.icc create mode 100644 Master/tlpkg/tlgs/iccprofiles/esrgb.icc create mode 100644 Master/tlpkg/tlgs/iccprofiles/rommrgb.icc create mode 100644 Master/tlpkg/tlgs/iccprofiles/scrgb.icc diff --git a/Master/source/ghostscript-9.26.tar.xz b/Master/source/ghostscript-9.26.tar.xz deleted file mode 100644 index 63dc5e1e44f..00000000000 Binary files a/Master/source/ghostscript-9.26.tar.xz and /dev/null differ diff --git a/Master/source/ghostscript-9.27.tar.xz b/Master/source/ghostscript-9.27.tar.xz new file mode 100644 index 00000000000..9efe9917dc5 Binary files /dev/null and b/Master/source/ghostscript-9.27.tar.xz differ diff --git a/Master/tlpkg/tlgs/README.TEXLIVE b/Master/tlpkg/tlgs/README.TEXLIVE index c99476aa1ba..9886c381f43 100644 --- a/Master/tlpkg/tlgs/README.TEXLIVE +++ b/Master/tlpkg/tlgs/README.TEXLIVE @@ -1,5 +1,5 @@ -This directory contains a subset of the Ghostscript 9.26 distribution +This directory contains a subset of the Ghostscript 9.27 distribution for Windows. The only purpose of this package is to support programs shipped with TeX Live. It's not intended for general use. diff --git a/Master/tlpkg/tlgs/Resource/CIDFont/ArtifexBullet b/Master/tlpkg/tlgs/Resource/CIDFont/ArtifexBullet index b4c571970fc..ce579f0610a 100644 Binary files a/Master/tlpkg/tlgs/Resource/CIDFont/ArtifexBullet and b/Master/tlpkg/tlgs/Resource/CIDFont/ArtifexBullet differ diff --git a/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultCMYK b/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultCMYK index 8ca5bbf347a..44d6daba26d 100644 --- a/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultCMYK +++ b/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultCMYK @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultGray b/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultGray index 65558ce30ef..d7b74f84e98 100644 --- a/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultGray +++ b/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultGray @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultRGB b/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultRGB index bdd67a9cf7a..6e8808f8ec9 100644 --- a/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultRGB +++ b/Master/tlpkg/tlgs/Resource/ColorSpace/DefaultRGB @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/ColorSpace/TrivialCMYK b/Master/tlpkg/tlgs/Resource/ColorSpace/TrivialCMYK index ad2e2e4057a..1679498378f 100644 --- a/Master/tlpkg/tlgs/Resource/ColorSpace/TrivialCMYK +++ b/Master/tlpkg/tlgs/Resource/ColorSpace/TrivialCMYK @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/ColorSpace/sGray b/Master/tlpkg/tlgs/Resource/ColorSpace/sGray index a6edea6838a..b821735719f 100644 --- a/Master/tlpkg/tlgs/Resource/ColorSpace/sGray +++ b/Master/tlpkg/tlgs/Resource/ColorSpace/sGray @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/ColorSpace/sRGB b/Master/tlpkg/tlgs/Resource/ColorSpace/sRGB index fca917f6417..95c6be73d8a 100644 --- a/Master/tlpkg/tlgs/Resource/ColorSpace/sRGB +++ b/Master/tlpkg/tlgs/Resource/ColorSpace/sRGB @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Decoding/FCO_Dingbats b/Master/tlpkg/tlgs/Resource/Decoding/FCO_Dingbats index 7d055dfa8ef..412b6bc0b0b 100644 --- a/Master/tlpkg/tlgs/Resource/Decoding/FCO_Dingbats +++ b/Master/tlpkg/tlgs/Resource/Decoding/FCO_Dingbats @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Decoding/FCO_Symbol b/Master/tlpkg/tlgs/Resource/Decoding/FCO_Symbol index a517abf96a4..d12c81eda0f 100644 --- a/Master/tlpkg/tlgs/Resource/Decoding/FCO_Symbol +++ b/Master/tlpkg/tlgs/Resource/Decoding/FCO_Symbol @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Decoding/FCO_Unicode b/Master/tlpkg/tlgs/Resource/Decoding/FCO_Unicode index 7619fc5aca3..5dd38cc26b2 100644 --- a/Master/tlpkg/tlgs/Resource/Decoding/FCO_Unicode +++ b/Master/tlpkg/tlgs/Resource/Decoding/FCO_Unicode @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Decoding/FCO_Wingdings b/Master/tlpkg/tlgs/Resource/Decoding/FCO_Wingdings index fe9c404e88e..e3b7acb44c3 100644 --- a/Master/tlpkg/tlgs/Resource/Decoding/FCO_Wingdings +++ b/Master/tlpkg/tlgs/Resource/Decoding/FCO_Wingdings @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Decoding/Latin1 b/Master/tlpkg/tlgs/Resource/Decoding/Latin1 index 6f331fcf520..eec0fbfdae7 100644 --- a/Master/tlpkg/tlgs/Resource/Decoding/Latin1 +++ b/Master/tlpkg/tlgs/Resource/Decoding/Latin1 @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Decoding/StandardEncoding b/Master/tlpkg/tlgs/Resource/Decoding/StandardEncoding index ceffe858933..c7775a25923 100644 --- a/Master/tlpkg/tlgs/Resource/Decoding/StandardEncoding +++ b/Master/tlpkg/tlgs/Resource/Decoding/StandardEncoding @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Decoding/Unicode b/Master/tlpkg/tlgs/Resource/Decoding/Unicode index abef982496d..0e2e185f157 100644 --- a/Master/tlpkg/tlgs/Resource/Decoding/Unicode +++ b/Master/tlpkg/tlgs/Resource/Decoding/Unicode @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Encoding/CEEncoding b/Master/tlpkg/tlgs/Resource/Encoding/CEEncoding index 5c956d2fdad..b5d2cb8b9e9 100644 --- a/Master/tlpkg/tlgs/Resource/Encoding/CEEncoding +++ b/Master/tlpkg/tlgs/Resource/Encoding/CEEncoding @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Encoding/ExpertEncoding b/Master/tlpkg/tlgs/Resource/Encoding/ExpertEncoding index f1685d7a999..ed6484db868 100644 --- a/Master/tlpkg/tlgs/Resource/Encoding/ExpertEncoding +++ b/Master/tlpkg/tlgs/Resource/Encoding/ExpertEncoding @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Encoding/ExpertSubsetEncoding b/Master/tlpkg/tlgs/Resource/Encoding/ExpertSubsetEncoding index 6ebecf75795..836f79e11f6 100644 --- a/Master/tlpkg/tlgs/Resource/Encoding/ExpertSubsetEncoding +++ b/Master/tlpkg/tlgs/Resource/Encoding/ExpertSubsetEncoding @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Encoding/NotDefEncoding b/Master/tlpkg/tlgs/Resource/Encoding/NotDefEncoding index aecee7f9c15..aeb0de47f86 100644 --- a/Master/tlpkg/tlgs/Resource/Encoding/NotDefEncoding +++ b/Master/tlpkg/tlgs/Resource/Encoding/NotDefEncoding @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Encoding/Wingdings b/Master/tlpkg/tlgs/Resource/Encoding/Wingdings index 8497c42a787..accbb48e524 100644 --- a/Master/tlpkg/tlgs/Resource/Encoding/Wingdings +++ b/Master/tlpkg/tlgs/Resource/Encoding/Wingdings @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Init/FCOfontmap-PCLPS2 b/Master/tlpkg/tlgs/Resource/Init/FCOfontmap-PCLPS2 index b94b0327420..c54e61d16e1 100644 --- a/Master/tlpkg/tlgs/Resource/Init/FCOfontmap-PCLPS2 +++ b/Master/tlpkg/tlgs/Resource/Init/FCOfontmap-PCLPS2 @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_agl.ps b/Master/tlpkg/tlgs/Resource/Init/gs_agl.ps index 61329dc326f..c30b631fac8 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_agl.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_agl.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_btokn.ps b/Master/tlpkg/tlgs/Resource/Init/gs_btokn.ps index c7fdcba82ac..3d6de33eb76 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_btokn.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_btokn.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -141,7 +141,7 @@ mark % 480 /DeviceN % 481 -- end -.packtomark .installsystemnames +//.packtomark exec .installsystemnames % Define printobject and writeobject. % These are mostly implemented in PostScript, so that we don't have to @@ -169,7 +169,7 @@ mark dup type //cntdict exch get exec } .bind def cntdict /arraytype { - dup dup length 5 -1 roll add 4 2 roll { .cntobj } forall + dup dup length 5 -1 roll add 4 2 roll { //.cntobj exec } forall } bind put cntdict /dicttype { WRITEDICTS { @@ -177,7 +177,7 @@ cntdict /dicttype { % We have to use .execn here, rather than simply rolling the % value under the top elements, because key might involve arrays % or dictionaries. - cvlit {.cntobj} exch 2 .execn .cntobj + cvlit {//.cntobj exec} exch 2 .execn //.cntobj exec } forall } { /writeobject .systemvar /typecheck signalerror @@ -217,7 +217,7 @@ cntdict /dicttype { dup length 0 3 -1 roll % Stack: file tag -mark- #refs #chars array - dup 4 1 roll { .cntobj } forall + dup 4 1 roll { //.cntobj exec } forall % Write the header. @@ -226,7 +226,7 @@ cntdict /dicttype { % Stack: -mark- array1 ... (array|dict)N tag #refs #chars file dup counttomark 1 sub index length 4 index 3 bitshift 4 index add - (xxxxxxxx) .bosheader writestring + (xxxxxxxx) //.bosheader exec writestring % Write the objects per se. @@ -277,39 +277,41 @@ cntdict /dicttype { } .bind def +/.writeobject { + 3 copy exch + % We must allocate the array in local VM + % to avoid a possible invalidaccess. + .currentglobal //false .setglobal exch 1 array astore exch .setglobal + //.writeobjects exec pop pop pop +} .bind def + /printobject { % printobject - currentobjectformat 0 eq { /printobject .systemvar /undefined signalerror } if - (%stdout) (w) file 2 index 2 index .writeobject pop pop + (%stdout) (w) file 2 index 2 index //.writeobject exec pop pop } odef + /writeobject { % writeobject - currentobjectformat 0 eq { /writeobject .systemvar /undefined signalerror } if 2 .argindex pop % check # of args - .writeobject + //.writeobject exec } odef -/.writeobject { - 3 copy exch - % We must allocate the array in local VM - % to avoid a possible invalidaccess. - .currentglobal //false .setglobal exch 1 array astore exch .setglobal - .writeobjects pop pop pop -} .bind def % Implement binary error message output. /.objectprinttest { % .objectprinttest - % This is a pseudo-operator so it will restore the stack % if it gets an error. - mark 0 0 3 .argindex .cntobj cleartomark pop -} bind odef + mark 0 0 3 .argindex //.cntobj exec cleartomark pop +} bind def /.printerror { $error /binary get .languagelevel 2 ge and { currentobjectformat 0 ne { [ /Error $error /errorname get $error /command get % Convert the object with cvs if it isn't printable. - dup { .objectprinttest } .internalstopped { + dup { //.objectprinttest exec } //.internalstopped exec { pop 100 string cvs } if //false ] 250 printobject @@ -328,3 +330,13 @@ currentdict /w2dict .undef end .setlanguagelevel + +% undefine things defined in this file and not referenced elsewhere +[ + /.objectprinttest + /.bosheader + /.cntobj + /.writeobject + /.writeobjects +] +{level2dict exch .forceundef} forall diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cet.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cet.ps index d3e1686409b..54f17c645d6 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cet.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cet.ps @@ -1,31 +1,34 @@ -%!PS % Set defaults for Ghostscript to match Adobe CPSI behaviour for CET -% do this in the server level so it is persistent across jobs -//true 0 startjob not { - (*** Warning: CET startup is not in server default) = flush +% skip if we've already run this -- based on fake "product" +systemdict /product get (PhotoPRINT SE 5.0v2) readonly eq +{ + (%END GS_CET) .skipeof } if +% Note: this must be run at save level 0 and when systemdict is writeable +currentglobal //true setglobal +systemdict dup dup dup +/version (3017.102) readonly .forceput % match CPSI 3017.102 +/product (PhotoPRINT SE 5.0v2) readonly .forceput % match CPSI 3017.102 +/revision 0 put % match CPSI 3017.103 Tek shows revision 5 +/serialnumber dup {233640} readonly .makeoperator .forceput % match CPSI 3017.102 Tek shows serialnumber 1401788461 + +systemdict /.odef { % odef - + 1 index exch //.makeoperator def +} .bind .forceput % this will be undefined at the end + 300 .sethiresscreen % needed for language switch build since it % processes gs_init.ps BEFORE setting the resolution 0 array 0 setdash % CET 09-08 wants local setdash -currentglobal //true setglobal -{ - systemdict dup dup dup - /version (3017.102) readonly put % match CPSI 3017.102 - /product (PhotoPRINT SE 5.0v2) readonly put % match CPSI 3017.102 - /revision 0 put % match CPSI 3017.103 Tek shows revision 5 - /serialnumber dup {233640} readonly .makeoperator put % match CPSI 3017.102 Tek shows serialnumber 1401788461 - systemdict /deviceinfo undef % for CET 20-23-1 -% /UNROLLFORMS true put % CET files do unreasonable things inside forms -} 1183615869 internaldict /superexec get exec - -/UNROLLFORMS true def - -{ } bind dup +/UNROLLFORMS //true def + +(%.defaultbgrucrproc) cvn { } bind def + +(%.defaultbgrucrproc) cvn load dup setblackgeneration setundercolorremoval 0 array cvx readonly dup dup dup setcolortransfer @@ -66,10 +69,62 @@ dup 7 -1 put % and GS_CHAR_FILL are now dynamic. Force CPSI compatibility. //true .setCPSImode +% Some QL jobs (/23-12B.PS for example) do: +% '(%stdin) (r) file' +% expecting that they are being read from stdin. +% if that is not the case, they block waiting for input +% from stdin. +% This hooks the 'file' operator', so if a job tries to +% open %stdin, and we're *not* reading the job from stdin +% it'll return currentfile instead. +/ofile /file load def +/file +{ + 1 index (%stdin) eq 2 index (%stdin%) eq or + { + ofile dup currentfile eq not + { + pop currentfile + }if + } + { + ofile + } ifelse +} bind //.odef exec +currentdict /ofile undef + +% One QL job (23-12B.PS) effectively does: +% (%stdin) (r) file 0 setfileposition +% expecting it to throw an ioerror (stdin not being a positionable +% stream. +% With the above 'file' hook, when running from a file +% rather than stdin, setfileposition will succeed, and we hit +% an infinite loop - '0 setfileposition' meaning we restart intepreting +% from the beginning of the file. +% Hook setfileposition to throw an error attempting to reposition +% the current file. +/osetfileposition /setfileposition load def +/setfileposition +{ + 1 index currentfile eq + { + /setfileposition cvx /ioerror signalerror + } + { + osetfileposition + } ifelse +} bind //.odef exec +currentdict /osetfileposition undef + setglobal -% Remove all but 'letter' page size +% Remove all but the default page size (the 0 entry in the InputAttributes +% dictionary). This is usually 'letter'. << +% As we're removing all but the default, make sure we're +% using the default. +/PageSize currentpagedevice /InputAttributes get 0 get /PageSize get + currentpagedevice /InputAttributes get 1 1 2 index length 1 sub { 1 index exch undef @@ -86,8 +141,8 @@ userdict /.smoothness currentsmoothness put } { /setsmoothness .systemvar /typecheck signalerror } ifelse -} bind odef -/currentsmoothness { userdict /.smoothness get } bind odef % for 09-55.PS, 09-57.PS . +} bind //.odef exec +/currentsmoothness { userdict /.smoothness get } bind //.odef exec % for 09-55.PS, 09-57.PS . % slightly nasty hack to give consistent cluster results /ofnfa systemdict /filenameforall get def @@ -106,6 +161,8 @@ userdict /.smoothness currentsmoothness put } ifelse ofnfa } bind def -% end of slightly nasty hack to give consistent cluster results -//false 0 startjob pop % re-enter encapsulated mode +systemdict /.odef .undef + +% end of slightly nasty hack to give consistent cluster results +%END GS_CET diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cff.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cff.ps index b60e3740572..125906132b7 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cff.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cff.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -33,33 +33,6 @@ % Load a font file that might be an OpenType CFF font set. -% .loadfontfile - -/.loadnonottofontfile /.loadfontfile load def -/.loadfontfile { - dup (12345678) .peekstring pop (wOFFOTTO) eq - { - .init_wOFF_otto_font_file - //true //false - }{//true} ifelse - - { - dup 4 string .peekstring pop (OTTO) eq - { - % If this is a font at all, it's an OpenType CFF font set. - .init_otto_font_file //true - } - { //false } ifelse - } if - - { % Use a random FontSet resource name. ****** WRONG ****** - realtime rand xor =string cvs exch //false //false - ReadData pop - } { - % Not a TrueType font. - .loadnonottofontfile - } ifelse -} bind def - % .init_otto_font_file /.init_otto_font_file { /FontSetInit /ProcSet findresource begin @@ -79,7 +52,7 @@ exch 3 -1 roll 1 add 16 mul 12 add sub f exch subfilefilter flushfile % skip to start f exch subfilefilter end -} bind def +} .bind executeonly odef % .init_otto_font_file /.init_wOFF_otto_font_file { @@ -116,8 +89,37 @@ { pop f exch subfilefilter /FlateDecode filter} ifelse end } bind def -20 dict begin +% .loadfontfile - +/.loadnonottofontfile /.loadfontfile load def +/.loadfontfile { + dup (12345678) .peekstring pop (wOFFOTTO) eq + { + //.init_wOFF_otto_font_file exec + //true //false + }{//true} ifelse + + { + dup 4 string .peekstring pop (OTTO) eq + { + % If this is a font at all, it's an OpenType CFF font set. + .init_otto_font_file //true + } + { //false } ifelse + } if + + { % Use a random FontSet resource name. ****** WRONG ****** + realtime rand xor =string cvs exch //false //false + ReadData pop + } { + % Not a TrueType font. + .loadnonottofontfile + } ifelse +} bind executeonly def + +currentdict /.init_wOFF_otto_font_file .forceundef + +20 dict begin % ------ Utilities ------ % /subfilefilter { % subfilefilter diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cidcm.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cidcm.ps index 60b0fdb2971..5ec2fa343ac 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cidcm.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cidcm.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_ciddc.ps b/Master/tlpkg/tlgs/Resource/Init/gs_ciddc.ps index f83e960b129..f0fb5d81c36 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_ciddc.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_ciddc.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cidfm.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cidfm.ps index 16ef97f0b5c..c0237283cd8 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cidfm.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cidfm.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -165,7 +165,7 @@ currentdict end def .libfile {closefile pop} { - {(r) file} .internalstopped + {(r) file} //.internalstopped exec {pop pop 2 index exch .undef} {closefile pop} ifelse } ifelse diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cidfn.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cidfn.ps index 74f1446bcd5..80b8008cf30 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cidfn.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cidfn.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -52,12 +52,14 @@ % FDArray. dup 0 { - 9 .checkfonttype { + 9 //.checkfonttype exec { /CIDInit /ProcSet findresource begin .completefont9 end } if - 1 index exch .buildfont9 exch pop + 1 index exch .buildfont9 + .currentresourcefile dup type /filetype eq { //.filename {1 index exch /ResourcePath exch put} if }{ pop} ifelse + exch pop } put % Don't bind it here, because gs_fapi.ps redefines .buildfont9 % Add entries to a new CIDFontType 0 font per documentation (FontMatrix) @@ -137,15 +139,19 @@ dup 0 { % ------ CIDFontType 1 (FontType 10) ------ % dup 1 { - 10 .checkfonttype pop - 1 index exch .buildfont10 exch pop + 10 //.checkfonttype exec pop + 1 index exch .buildfont10 + .currentresourcefile dup type /filetype eq { //.filename {1 index exch /ResourcePath exch put} if }{ pop} ifelse + exch pop } put % Don't bind it here because gs_fapi.ps redefines .buildfont10 % ------ CIDFontType 2 (FontType 11) ------ % dup 2 { - 11 .checkfonttype pop - 1 index exch .buildfont11 exch pop + 11 //.checkfonttype exec pop + 1 index exch .buildfont11 + .currentresourcefile dup type /filetype eq { //.filename {1 index exch /ResourcePath exch put} if }{ pop} ifelse + exch pop } put % Don't bind it here because gs_fapi.ps redefines .buildfont11 pop % .cidfonttypes @@ -172,7 +178,7 @@ pop % .cidfonttypes exch pop {stop}if }if currentfile fileposition - } .internalstopped { + } //.internalstopped exec { % File is not positionable, or uses hex data. % Load the data now. cleartomark exch @@ -282,7 +288,7 @@ currentdict end /.readglyphdata { currentfont exch .type9mapcid FDArray exch get exch -} bind def +} bind executeonly def % BuildGlyph procedure for CIDFontType 0. % The name %Type9BuildGlyph is known to the interpreter. @@ -290,9 +296,9 @@ currentdict end (%Type9BuildGlyph) cvn { % %Type9BuildGlyph - .currentglobal 3 1 roll 1 index gcheck .setglobal 1 index begin - dup .readglyphdata dup //null eq { + dup //.readglyphdata exec dup //null eq { % Substitute CID 0. **** WRONG **** - pop pop 0 .readglyphdata + pop pop 0 //.readglyphdata exec } if % Stack: cidfont cid subfont charstring dup //null eq { pop pop pop pop } { %**** WRONG **** @@ -302,7 +308,7 @@ currentdict end } ifelse %**** WRONG **** end .setglobal -} bind def +} bind executeonly def % ------ CIDFontType 2 ------ % @@ -310,12 +316,12 @@ currentdict end % The name %Type11BuildGlyph is known to the interpreter. (%Type11BuildGlyph) cvn { % %Type11BuildGlyph - % We must be prepared for out-of-range CIDs. - 2 copy { .type11mapcid } .internalstopped { + 2 copy { .type11mapcid } //.internalstopped exec { pop /CharStrings get /.notdef get } if % Stack: cidfont cid glyphindex 1 index exch .type42execchar -} bind def +} bind executeonly def % ---------------- Define resources ---------------- % @@ -346,7 +352,7 @@ languagelevel exch 2 .setlanguagelevel /ProvideUnicodeDecoding get exec } if dup /CIDFontType get //.cidfonttypes exch get exec -} odef +} bind executeonly odef /CIDFont /Generic /Category findresource dup length dict .copydict dup /InstanceType /dicttype put @@ -371,9 +377,9 @@ dup /DefineResource { } bind def dup /.LoadResource { currentglobal { - .loadcidfontresource + //.loadcidfontresource exec } { - //true setglobal {.loadcidfontresource} stopped //false setglobal {stop} if + //true setglobal {//.loadcidfontresource exec} stopped //false setglobal {stop} if } ifelse } bind put @@ -411,3 +417,10 @@ dup /.CheckResource { %% Replace 1 (gs_ciddc.ps) (gs_ciddc.ps) runlibfile + +% Undef these, not needed outside this file +[ + /.checkfonttype + /.loadcidfontresource + /.readglyphdata +] {systemdict exch .forceundef} forall diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cidtt.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cidtt.ps index a8aa10c98e0..12ade5e5908 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cidtt.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cidtt.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -116,7 +116,7 @@ currentdict /super.complete_instance currentdict /complete_instance get put } if closefile } { - (r) { file } .internalstopped + (r) { file } //.internalstopped exec { (Can't find the font file ) print = /findfont cvx /undefinedfilename signalerror diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cmap.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cmap.ps index a01afc23feb..2733ea3b14c 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cmap.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cmap.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -74,7 +74,7 @@ CMap /WMode .knownget { /WMode exch def } if /FontType 0 def pop pop currentdict end -} bind odef +} bind executeonly odef % composefont doesn't appear in CMap files -- it's documented in % the "PostScript Language Reference Manual Supplement". @@ -118,7 +118,7 @@ } bind def /endcmap { % - endcmap - - .rewriteTempMapsNotDef + //.rewriteTempMapsNotDef exec CMAPDEBUG { 2 (*** undefined charmap ***) @@ -539,11 +539,13 @@ dup /DefineResource { } bind executeonly put /Category defineresource pop % We might have loaded CID font support already. -/CIDInit /ProcSet 2 copy { findresource } .internalstopped +/CIDInit /ProcSet 2 copy { findresource } //.internalstopped exec % An interior `stopped' might have reset VM allocation to local. //true .setglobal { pop pop 3 -1 roll } { dup length 4 index length add dict .copydict 4 -1 roll exch .copydict } ifelse exch defineresource pop +currentdict /.rewriteTempMapsNotDef .undef + .setlanguagelevel diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cspace.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cspace.ps index c612ea9acf4..ff5955a9577 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cspace.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cspace.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -61,19 +61,6 @@ end % colorspacedict /DeviceRGB_array /DeviceRGB 1 array astore readonly def /DeviceCMYK_array /DeviceCMYK 1 array astore readonly def -% -% - initgraphics - -% -% Although the internal routine gs_initgraphics resets the color space, -% it does not reset the color space we store in the 'interpreter' -% graphics state (so that we can hand it back in currentcolorspace). -% So we need to do that in the PostScript world. -% -% -/initgraphics - { initgraphics systemdict /DeviceGray_array get setcolorspace } -.bind odef - % % These routines used for the NOSUBSTDEVICECOLORS switch. This prevents % substitution of DeviceGray, DeviceRGB and DeviceCMYK with a Default* @@ -92,6 +79,8 @@ end % colorspacedict % If the boolean is true then the C code must set the additional colour space % and execute .includecolorspace before finally setting a DeviceGray space. % +% called from C code, can't undef. Use this to trigger the code: +% -sDEVICE=pkmraw -dMaxBitmap=4000m -r72 -dNOSUBSTDEVICECOLORS ./tests/Ghent_V3.0/110_defaultcolourspace_x3.pdf /..nosubstdevicetest { //false mark 3 -1 roll @@ -118,67 +107,6 @@ end % colorspacedict } ifelse }bind def -% -% ..includecolorspace - -% -/..includecolorspace -{ - % If we have already recorded this space, don't repeat it. - systemdict /..page_default_spaces get 1 index known { - pop - } { - mark exch - { - % Check to see if this space was defined by defineresource, if so then - % the job defined it, otherwise its the usual default, so ignore it. - dup /ColorSpace resourcestatus { - pop 0 eq { - % Job defined /Default*, so record it and allow the device access to it - systemdict /..page_default_spaces get 1 index //true put - gsave - { dup /ColorSpace findresource //setcolorspace exec .includecolorspace - } stopped pop - grestore - } if - } if - } stopped pop - cleartomark - } ifelse -} bind def - -% -% cs_substitute_generic -% -/cs_substitute_generic -{ .getuseciecolor - {NOSUBSTDEVICECOLORS - { //..includecolorspace exec dup } - { /ColorSpace findresource } - ifelse - } - { pop dup } - ifelse -} -bind def - -% -% cs_substitute_DeviceRGB_for_PDFX_or_PDFA -% -/cs_substitute_DeviceRGB_for_PDFX_or_PDFA -{ systemdict /PDFX .knownget not { //false } if - systemdict /PDFA .knownget not { //false } {0 eq {//false}{//true} ifelse} ifelse - or { - dup /ColorSpace resourcestatus { - pop pop - } { - (Error: Need a /DefaultRGB /ColorSpace resource for generating a PDF/X or PDF/A document.) = - /cs_substitute_DeviceRGB_for_PDFX_or_PDFA cvx /undefined signalerror - } ifelse - /ColorSpace findresource - } { - //cs_substitute_generic exec - } ifelse -} bind def end % diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_dbt_e.ps b/Master/tlpkg/tlgs/Resource/Init/gs_dbt_e.ps index 54692f447d3..01e3c8240ba 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_dbt_e.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_dbt_e.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_diskn.ps b/Master/tlpkg/tlgs/Resource/Init/gs_diskn.ps index fd694bc44b5..d3402782d81 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_diskn.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_diskn.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -51,7 +51,7 @@ systemdict begin mark 5 1 roll ] mark exch { { } forall } forall ] //systemdict /.searchabledevs 2 index .forceput exch .setglobal - } + } executeonly if } .bind executeonly odef % must be bound and hidden for .forceput @@ -129,7 +129,7 @@ systemdict begin 2 index 0 get 37 eq { [ () ] } { .getsearchabledevs } ifelse { 3 index concatstrings % prepend the device { - 2 index //file } .internalstopped not { + 2 index //file } //.internalstopped exec not { 4 1 roll pop pop pop //true exit % exit with success } { @@ -151,7 +151,7 @@ systemdict begin //false % success code 1 index 0 get 37 eq { [ () ] } { .getsearchabledevs } ifelse { 2 index concatstrings % prepend the device - { //deletefile } .internalstopped exch pop not { + { //deletefile } //.internalstopped exec exch pop not { pop //true exit % exit with success } if @@ -166,7 +166,7 @@ systemdict begin //false % success code 1 index 0 get 37 eq { [ () ] } { .getsearchabledevs } ifelse { 2 index concatstrings % prepend the device - { //status } .internalstopped not { + { //status } //.internalstopped exec not { { //true 7 -2 roll pop pop //true exit } % exit with success if } @@ -187,7 +187,7 @@ systemdict begin //false % success code 2 index 0 get 37 eq { [ () ] } { .getsearchabledevs } ifelse { dup 4 index concatstrings % prepend the device - { (r) //file } .internalstopped + { (r) //file } //.internalstopped exec not { closefile exch pop //true exit % exit with success } { diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_dpnxt.ps b/Master/tlpkg/tlgs/Resource/Init/gs_dpnxt.ps deleted file mode 100644 index 8e7e241d612..00000000000 --- a/Master/tlpkg/tlgs/Resource/Init/gs_dpnxt.ps +++ /dev/null @@ -1,133 +0,0 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. -% All Rights Reserved. -% -% This software is provided AS-IS with no warranty, either express or -% implied. -% -% This software is distributed under license and may not be copied, -% modified or distributed except as expressly authorized under the terms -% 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., 1305 Grant Avenue - Suite 200, Novato, -% CA 94945, U.S.A., +1(415)492-9861, for further information. -% - -% gs_dpnxt.ps -% NeXT Display PostScript extensions - -% Define the operation values for compositing. These must match the values -% in gsdpnext.h, which also are the ones from the NeXT documentation. -% We put them in systemdict, which seems like as good a place as any. -mark - /Clear /Copy /Sover /Sin /Sout /Satop /Dover /Din /Dout /Datop /Xor - /PlusD /PlusL /Highlight % not sure about Highlight -counttomark { counttomark 1 sub def } repeat pop - -% We implement readimage and sizeimage using the following 3 otherwise -% undocumented lower-level operators: -% -% .sizeimagebox -% -% -% - .sizeimageparams -% -% -% .getbitsrect -% -% NOTE: These operators are subject to change without notice! - -% Implement readimage using .getbitsrect. Experimentation on a NeXT system -% shows that the data is always returned in order of increasing device Y, -% regardless of the CTM. -% -% Note that we can't make stack protection work for this operator, -% because it must remove its operands from the stack before calling -% the supplied procedure(s). - -/readimage { % [... ] - % readimage - - .sizeimageparams exch { - % multiproc = true. If N > 1, store the procedures in an array. - exch pop 1 index { 1 add } if - % Stack: ... string alpha? nprocs - dup 1 eq { - pop //false % only 1 procedure, multiproc is irrelevant - } { - dup array 4 1 roll 3 add 2 roll astore 3 1 roll //true - } ifelse - } { - % multiproc = false. - pop pop //false - } ifelse - % Map the rectangle to device coordinates. - % Stack: x y w h proc(s) str alpha? multi? - 8 -4 roll matrix .sizeimagebox pop 8 4 roll - % Make sure we allocate the operand array in local VM - % to avoid a possible invalidaccess. - .currentglobal //false .setglobal 9 1 roll - exch { 1 } { 0 } ifelse exch % alpha is last, if present - exch 4 1 roll 8 array astore exch .setglobal - { % Read out a block of scan lines and pass them to the procedure. - % Stack: [x y w h alpha? proc(s) str multi?] -- we must consume this. - dup 3 get 0 eq { pop exit } if - aload 9 1 roll pop exch pop currentdevice 7 1 roll - % Always read out the data as standard (not native) pixels. - .sizeimageparams pop pop exch .getbitsrect - % Stack: [x y w h alpha? proc(s) str multi?] hread substr - 3 -1 roll - % Stack: hread substr [x y w h alpha? proc(s) str multi?] - dup 1 2 copy get 5 index add put - % Stack: hread substr [x y' w h alpha? proc(s) str multi?] - dup 3 2 copy get 6 -1 roll sub put - % Stack: substr [x y' w h' alpha? proc(s) str multi?] - dup 5 get exch 7 get { - % multiproc = true, pass each plane to a different procedure. - % Stack: substr procs - 0 1 2 index length 1 sub { - % Push 1 plane and its procedure under the top 2 elements. - % Stack: ... substr procs plane# - 2 index length 2 index length idiv % bytes per plane - dup 2 index mul exch - % Stack: ... substr procs plane# start length - 4 index 3 1 roll getinterval 4 1 roll - 2 copy get 4 1 roll pop - } for - exch pop length 2 mul .execn - } { - % multiproc = false, just call the procedure. - exec - } ifelse - } //systemdict /exec get 3 packedarray cvx loop -} bind odef - -% -% ... alphaimage - -% -img_utils_dict begin -/.alphaimage where - { - pop - .currentglobal //true .setglobal - /alphaimage - { - //true - //.colorimage - stopped - { /alphaimage .systemvar $error /errorname get signalerror } - if - } - .bind systemdict begin odef end - .setglobal - } -if -end - -% Implement sizeimage using lower-level operators. - -/sizeimage { % sizeimage - % - % - .sizeimagebox 5 -2 roll pop pop - .sizeimageparams 3 -1 roll 4 1 roll -} bind odef diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_dps.ps b/Master/tlpkg/tlgs/Resource/Init/gs_dps.ps deleted file mode 100644 index 00c14d53204..00000000000 --- a/Master/tlpkg/tlgs/Resource/Init/gs_dps.ps +++ /dev/null @@ -1,222 +0,0 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. -% All Rights Reserved. -% -% This software is provided AS-IS with no warranty, either express or -% implied. -% -% This software is distributed under license and may not be copied, -% modified or distributed except as expressly authorized under the terms -% 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., 1305 Grant Avenue - Suite 200, Novato, -% CA 94945, U.S.A., +1(415)492-9861, for further information. -% - -% Initialization file for Display PostScript functions. - -% ------ Errors ------ % - -% These errors are only defined in DPS. -{ /invalidcontext /invalidid } { .registererror } forall - -% ------ Contexts ------ % - -% To create a context with private local VM, we use the .localfork -% operator to actually create the context, the new VM, and an empty -% userdict, and then we call the .initlocaldicts procedure to make -% local copies of the initial contents of the dictionaries in local VM. -% savedlocaldicts in systemdict is a global read-only dictionary whose -% elements are global read-only copies of these initial contents; -% we just copy its elements into local VM and install them in systemdict. -% userdict and internaldict require special handling. - -% Switching between contexts with different local VMs requires -% changing the bindings in systemdict that reference local objects. -% For this purpose, each userdict has an entry called localdicts -% which holds the local copies of the elements of savedlocaldicts, -% plus internaldict. The context switching code in the interpreter -% effectively copies this dictionary into systemdict. -% NOTE: the name localdicts is known to the interpreter. - -% Switching between contexts also requires resetting the user parameters. -% The interpreter records the value of userparams (a local dictionary -% referenced from systemdict) for each context, and uses it for this. -% See gs_lev2.ps for more details. -% NOTE: the name userparams is known to the interpreter. - -% Save copies of local dictionaries at the end of system initialization. -% Also save the initial gstate. -/.savelocalstate { - .currentglobal //true .setglobal - //systemdict /savedlocaldicts mark //systemdict { - dup gcheck { - pop pop - } { - dup type /dicttype eq { - % Save a copy of this dictionary in global VM. - dup maxlength dict .copydict readonly - } { - pop pop - } ifelse - } ifelse - } forall .dicttomark readonly put - % Create localdicts for the current context. - //false .setglobal - userdict /localdicts mark savedlocaldicts { - pop dup load - } forall /internaldict dup load - .dicttomark readonly put - % Save a copy of the initial gstate. - //systemdict /savedinitialgstate gstate readonly .forceput - .setglobal -} .bind executeonly odef % must be bound and hidden for .forceput - -% Initialize local dictionaries and gstate when creating a new context. -% Note that until this completes, we are in the anomalous situation of -% having systemdict point to dictionaries that are in a non-current -% local VM. Because of this, we turn off garbage collection temporarily. -/.copylocal { % .copylocal - % Copy a dictionary to the current (local) VM, - % and make it read-only if its current definition is. - dup maxlength dict .copydict - 1 index load wcheck not { readonly } if -} .bind def -% When this is called, the dictionary stack is in its initial state, -% and there is (anomalously) only one gstate on the gstate stack. -/.initlocaldicts { % - .initlocaldicts - - -2 vmreclaim - .currentglobal //systemdict begin - //false .setglobal - % Since localdicts doesn't exist yet, references from - % systemdict to local objects won't get restored if - % a context switch happens in this code. Therefore, - % until localdicts is defined, we have to keep all our - % state on the operand stack. - - % Acquire userdict. - %****** WRONG IF NON-STANDARD INITIAL DSTACK ****** - countdictstack array dictstack - { dup gcheck not { exit } if pop } forall - % Create localdicts with a local copy of each dictionary, - % except for userdict and userparams, which just need - % to be filled in. - mark savedlocaldicts { - 1 index /userdict eq { - % Stack: userdict mark ... /userdict inituserdict - counttomark 1 add index .copydict - } { - 1 index /userparams eq { - % Stack: userdict mark ... /userparams inituserparams - userparams .copydict - } { - .copylocal - } ifelse - } ifelse - } forall /internaldict dup .makeinternaldict .makeoperator - .dicttomark readonly /localdicts exch put - % localdicts is now defined in userdict. - % Copy the definitions into systemdict. - localdicts { .forcedef } forall - % Set the user parameters. - userparams readonly .setuserparams - % Establish the initial gstate(s). - /savedinitialgstate .systemvar setgstate gsave - % Wrap up. - end .setglobal -} bind executeonly odef - -% Check whether an object is a procedure. -/.proccheck { % .proccheck - dup xcheck - exch type dup /arraytype eq exch /packedarraytype eq or and -} bind def - -% Create a context with private local VM. -% The .localfork operator does all the work, but we must ensure that -% .initlocaldicts gets called when the new context starts up. -/localfork { % ... - % - % localfork - .currentglobal //true .setglobal 3 index - dup .proccheck not { - pop .setglobal /localfork .systemvar /typecheck signalerror - } if - {exec .initlocaldicts} aload pop - 3 1 roll 3 packedarray cvx - 4 1 roll 5 -1 roll pop .setglobal .localfork -} odef - -% Fork a context that shares VM. The .fork operator creates an empty -% userparams dictionary for the context, but we still need to initialize -% this dictionary when the new context starts up. -/.postfork { % - .postfork - - % Initialize the user parameters. - savedlocaldicts /userparams get userparams .copydict readonly pop -} odef -/fork { % ... fork - .currentglobal //false .setglobal 1 index - dup .proccheck not { - pop .setglobal /fork .systemvar /typecheck signalerror - } if - {exec .postfork} aload pop - 3 1 roll 3 packedarray cvx - 3 1 roll exch pop .setglobal .fork -} odef - -% ------ Halftone phase ------ % - -/sethalftonephase { % sethalftonephase - - -1 2 index 2 index .setscreenphase pop pop -} odef -/currenthalftonephase { % - currenthalftonephase - 0 .currentscreenphase -} odef - -% ------ Device-source images ------ */ - -.imagetypes 2 /.image2 load put - -% ------ Device information ------ % - -/.deviceinfodict mark - /Colors //null /GrayValues //null /RedValues //null /GreenValues //null - /BlueValues //null /ColorValues //null -.dicttomark readonly def -/deviceinfo { % - deviceinfo - currentdevice //.deviceinfodict .getdeviceparams .dicttomark - dup begin - /ColorValues .knownget { - 0 le - { currentdict /ColorValues undef } - { - % hack around devices that incorrect set GrayValues - Colors 3 eq { 1 } { GrayValues } ifelse - RedValues mul GreenValues mul BlueValues mul ColorValues ne - { currentdict /GrayValues undef - currentdict /RedValues undef - currentdict /GreenValues undef - currentdict /BlueValues undef - } if - } - ifelse - } if - currentdict end readonly -} odef - -% The current implementation allocates a 2-element array each time. -% Perhaps we should change this to 2 separate parameters for X and Y? -/.wtdict mark - /wtranslation //null -.dicttomark readonly def -/wtranslation { % - wtranslation - currentdevice //.wtdict .getdeviceparams exch pop exch pop aload pop -} odef -currentdict /.wtdict .undef - -% ------ View clipping ------ % - -/rectviewclip { % rectviewclip - - % rectviewclip - - newpath .rectappend viewclip -} odef diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_dps1.ps b/Master/tlpkg/tlgs/Resource/Init/gs_dps1.ps index ec5db61b9f0..7cf29b46b81 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_dps1.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_dps1.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -33,14 +33,17 @@ systemdict begin /SharedFontDirectory .FontDirectory .gcheck { .currentglobal //false .setglobal + currentdict /LocalFontDirectory .FontDirectory dup maxlength dict copy - .forcedef % LocalFontDirectory is local, systemdict is global + .forceput % LocalFontDirectory is local, systemdict is global .setglobal .FontDirectory - } - { /LocalFontDirectory .FontDirectory - .forcedef % LocalFontDirectory is local, systemdict is global + } executeonly + { + currentdict + /LocalFontDirectory .FontDirectory + .forceput % LocalFontDirectory is local, systemdict is global 50 dict - } + }executeonly ifelse def end % systemdict @@ -55,7 +58,7 @@ level2dict begin { //SharedFontDirectory } { /LocalFontDirectory .systemvar } % can't embed ref to local VM ifelse .forceput pop % LocalFontDirectory is local, systemdict is global - } .bind odef + } .bind executeonly odef % Don't just copy (load) the definition of .setglobal: % it gets redefined for LL3. /setshared { /.setglobal .systemvar exec } odef @@ -67,25 +70,26 @@ level2dict begin /selectfont % selectfont - { - { 1 .argindex findfont + { + 1 .argindex findfont 1 index dup type /arraytype eq { makefont } { scalefont } ifelse setfont pop pop } stopped { /selectfont .systemvar $error /errorname get signalerror } if } odef % undefinefont has to take local/global VM into account. /undefinefont % undefinefont - - { .FontDirectory 1 .argindex .forceundef % FontDirectory is readonly + { //.FontDirectory 1 .argindex .forceundef % FontDirectory is readonly .currentglobal { % Current mode is global; delete from local directory too. //systemdict /LocalFontDirectory .knownget - { 1 index .forceundef } % LocalFontDirectory is readonly + { 1 index .forceundef } executeonly % LocalFontDirectory is readonly if } { % Current mode is local; if there was a shadowed global % definition, copy it into the local directory. //systemdict /SharedFontDirectory .knownget { 1 index .knownget - { .FontDirectory 2 index 3 -1 roll { put } systemdict /superexec known {//superexec}{1183615869 internaldict /superexec get exec} ifelse } % readonly + { //.FontDirectory 2 index 3 -1 roll .forceput } % readonly if } if @@ -126,7 +130,7 @@ level2dict begin } ifelse } forall - pop counttomark 2 idiv { .forceundef } repeat pop % readonly + pop counttomark 2 idiv { .forceundef } executeonly repeat pop % readonly } if //SharedFontDirectory exch .forcecopynew pop diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_dps2.ps b/Master/tlpkg/tlgs/Resource/Init/gs_dps2.ps index 64faeda37e0..fe3ca27dd5b 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_dps2.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_dps2.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -34,7 +34,7 @@ level2dict begin { { exch pop } % halftone { /HalftoneType 1 % screen { /Frequency /Angle /SpotFunction } - .makestackdict readonly + //.makestackdict exec readonly } { /HalftoneType 2 % colorscreen { /RedFrequency /RedAngle /RedSpotFunction @@ -42,11 +42,13 @@ level2dict begin /BlueFrequency /BlueAngle /BlueSpotFunction /GrayFrequency /GrayAngle /GraySpotFunction } - .makestackdict readonly + //.makestackdict exec readonly } } exch get exec } odef +currentdict /.makestackdict undef + % Define sethalftone so it converts types 1-4 to type 5. /.makehalftoneRGBV { % 4 -1 roll exch { 1 index exch get exch } forall 15 1 roll @@ -79,7 +81,7 @@ systemdict begin /GreenFrequency /GreenAngle /GreenSpotFunction /BlueFrequency /BlueAngle /BlueSpotFunction /GrayFrequency /GrayAngle /GraySpotFunction - } .makehalftoneRGBV + } //.makehalftoneRGBV exec } bind def 3 { mark exch /Default exch .dicttomark { .sethalftone5 } @@ -90,7 +92,7 @@ systemdict begin /GreenWidth /GreenHeight /GreenThresholds /BlueWidth /BlueHeight /BlueThresholds /GrayWidth /GrayHeight /GrayThresholds - } .makehalftoneRGBV + } //.makehalftoneRGBV exec } bind def 5 { pop dup length dict copy @@ -115,6 +117,8 @@ systemdict begin } bind def end end +currentdict /.makehalftoneRGBV undef + /sethalftone { % sethalftone - % We must create the new dictionary in the same VM as the % operand; otherwise, invalidaccess errors may occur. @@ -144,16 +148,18 @@ end } bind def /setscreen % setscreen - { dup type /dicttype eq - { .fixsethalftonescreen sethalftone pop pop pop } + { //.fixsethalftonescreen exec sethalftone pop pop pop } { //setscreen } ifelse } .bind odef /setcolorscreen % setcolorscreen - { dup type /dicttype eq - { .fixsethalftonescreen sethalftone 12 { pop } repeat } + { //.fixsethalftonescreen exec sethalftone 12 { pop } repeat } { //setcolorscreen } ifelse } .bind odef +currentdict /.fixsethalftonescreen undef + % Redefine currentscreen and currentcolorscreen to extract the Frequency % and Angle from Type 1 halftones, per Adobe TN 5085. /.fixcurrenthalftonescreen % .fix... @@ -164,17 +170,17 @@ end } bind def /currentscreen % - currentscreen 60 0 { .currenthalftone - { { .fixcurrenthalftonescreen } % halftone + { { //.fixcurrenthalftonescreen exec }% halftone { } % screen { 12 3 roll 9 { pop } repeat % colorscreen - dup type /dicttype eq { .fixcurrenthalftonescreen } if + dup type /dicttype eq { //.fixcurrenthalftonescreen exec } if } } exch get exec } odef /currentcolorscreen % - currentcolorscreen (60 0 )*4 { .currenthalftone - { { .fixcurrenthalftonescreen 3 copy 6 copy } % halftone + { { //.fixcurrenthalftonescreen exec 3 copy 6 copy } % halftone { % screen % The procedure might not be readable.... dup rcheck { dup length array copy cvx } if @@ -184,12 +190,13 @@ end } exch get exec } odef +currentdict /.fixcurrenthalftonescreen undef % ------ User objects ------ % /.UserObjects { .userdict /UserObjects -} odef +} bind executeonly odef % In order to get proper error recovery behavior, we need to be careful % not to pop any operands from the stack until we're done. % The code below faithfully duplicates the apparent array-growing @@ -213,21 +220,22 @@ end .UserObjects 3 .argindex 1 add 10 .max .localvmarray put } ifelse .UserObjects get 2 .argindex 2 index put pop pop -} odef +} bind odef /execuserobject { % execuserobject - dup type /integertype ne { % Adobe validates the argument before accessing UserObjects - CET 31-03 /execuserobject .systemvar /typecheck signalerror } if .UserObjects get 1 .argindex get exch pop exec -} odef +} bind odef /undefineuserobject { % undefineuserobject - dup type /integertype ne { % Adobe validates the argument before accessing UserObjects - CET 31-11 /undefineuserobject .systemvar /typecheck signalerror } if .UserObjects get 1 .argindex //null put pop -} odef +} bind odef +currentdict /.UserObjects undef % ------ Cache control ------ % diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_dscp.ps b/Master/tlpkg/tlgs/Resource/Init/gs_dscp.ps index d1a668b9d8a..dad0ec30e2f 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_dscp.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_dscp.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_epsf.ps b/Master/tlpkg/tlgs/Resource/Init/gs_epsf.ps index 2d0f6774716..b337f42856f 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_epsf.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_epsf.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -44,7 +44,7 @@ } { cleartomark //false } ifelse -} bind def +} bind executeonly odef % Crop the page to the BoundingBox /EPSBoundingBoxCrop { % llx lly urx ury -- @@ -54,7 +54,7 @@ exch 3 index sub exch 2 index sub % stack: llx lly urx-llx ury-lly << /PageSize [ 5 -2 roll ] >> setpagedevice neg exch neg exch translate -} bind def +} bind executeonly odef % Rescale, translate and rotate to fit the BoundingBox on the page /EPSBoundingBoxFitPage { % llx lly urx ury -- @@ -69,9 +69,18 @@ 6 index 10 index sub 6 index 10 index sub gt % bbox page-clipbox page-is-landscape bbox-is-landscape xor }{ - false + //false }ifelse - 9 1 roll % compute need-rotate. + dup 10 1 roll % need-rotate compute need-rotate. + + % if we are rotating the contents, we need to also rotate the + % bounding box of the content! + { + 8 -4 roll + exch 4 -2 roll exch 4 2 roll + 8 4 roll + } if + % stack: rotate-needed bbox page-clipbox % calculate scale to fit smaller of width or height exch 4 -1 roll sub 3 1 roll exch sub @@ -84,8 +93,8 @@ % translate to EPS -llx,-lly exch neg exch neg translate % Finally perform the rotate if needed. - { clippath pathbbox pop 0 exch translate 90 rotate pop pop } if -} bind def + { clippath pathbbox pop 0 translate 90 rotate pop pop } if +} bind executeonly odef /EPSBoundingBoxProcess { % (llx lly urx ury) state -- //systemdict /EPSBoundingBoxState get 1 index lt { @@ -121,7 +130,8 @@ } { pop pop } ifelse -} bind def +} bind executeonly odef + /ProcessEPSComment { % file comment -- file comment /EPSBoundingBoxState .systemvar 3 lt { @@ -184,19 +194,20 @@ } ifelse } ifelse } if -} bind def +} bind executeonly def % Install EPS handler for DSC comments, which we do later /EPSBoundingBoxInit { systemdict /NOEPS known not { % Merge ProcessEPSComment with existing handler - /ProcessEPSComment load /exec load + //ProcessEPSComment /exec load currentuserparams /ProcessDSCComment get dup //null eq {pop {pop pop}} if /exec load 4 array astore cvx readonly << /ProcessDSCComment 3 -1 roll >> setuserparams } if -} bind def +} bind executeonly odef + /.runNoEPS /run load def @@ -206,13 +217,13 @@ /runEPS_op_count count 2 sub def /runEPS_page_count currentpagedevice /PageCount get def 0 EPSBoundingBoxSetState - .runNoEPS + //.runNoEPS currentpagedevice /PageCount get runEPS_page_count sub 0 eq { /showpage load exec } if count runEPS_op_count sub {pop} repeat countdictstack runEPS_dict_count sub {end} repeat runEPS_save restore -} bind def +} bind executeonly odef /run { % file OR string -- dup type /filetype ne { (r) file } if @@ -223,29 +234,29 @@ pop pop pop EPSDEBUG {(runEPS: Found EPS\n) print flush} if systemdict /NOEPS known { - cvx .runNoEPS + cvx //.runNoEPS } { cvx .runEPS } ifelse } { EPSDEBUG {(runEPS: Normal DSC\n) print flush} if pop - cvx .runNoEPS + cvx //.runNoEPS } ifelse } { EPSDEBUG {(runEPS: Short DSC\n) print flush} if pop - cvx .runNoEPS + cvx //.runNoEPS } ifelse } { EPSDEBUG {(runEPS: Not DSC\n) print flush} if - cvx .runNoEPS + cvx //.runNoEPS } ifelse } { EPSDEBUG {(runEPS: Short non-DSC\n) print flush} if pop - cvx .runNoEPS + cvx //.runNoEPS } ifelse } bind odef @@ -278,7 +289,7 @@ % Now interpret the PostScript. exch () /SubFileDecode filter cvx run } - { .runnoepsf + { //.runnoepsf } ifelse } odef @@ -289,3 +300,17 @@ userdict begin { (%stdin) run } execute0 } bind def end + +% undefine things defined in this file and not referenced elsewhere +[ + /.runNoEPS + /.runnoepsf + /.runEPS + /EPSBoundingBoxSetState + /EPSBoundingBoxCrop + /EPSBoundingBoxFitPage + /EPSBoundingBoxParse + /EPSBoundingBoxProcess + /ProcessEPSComment +] +{currentdict exch .forceundef} forall diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_fapi.ps b/Master/tlpkg/tlgs/Resource/Init/gs_fapi.ps index ac3c27d299b..53b744604fa 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_fapi.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_fapi.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps b/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps index c1f7651f18c..196c8641418 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -401,12 +401,12 @@ currentdict end def .forceput % FontInfo can be read-only. pop % bool exit - } if + } executeonly if dup /FontInfo get % bool /GlyphNames2Unicode /Unicode /Decoding findresource .forceput % FontInfo can be read-only. exit - } loop + } executeonly loop exch setglobal } .bind executeonly odef % must be bound and hidden for .forceput diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_fonts.ps b/Master/tlpkg/tlgs/Resource/Init/gs_fonts.ps index 803faca4918..c47f6e57767 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_fonts.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_fonts.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -24,11 +24,18 @@ % consistent with the one specified here. /defaultfontmap (Fontmap) def +% we have to set .languagelevel to 2 so the parser will accept the names +% '<<' and '>>', then we use a local definition here. +.languagelevel 2 .setlanguagelevel /defaultfontmap_content 50 dict -1 dict begin +4 dict begin +(<<) cvn /mark load def +(>>) cvn /.dicttomark load def /; { 2 index 3 1 roll .growput } bind def %% Replace 0 (Fontmap) end def +.setlanguagelevel + % ------ End of editable parameters ------ % @@ -45,7 +52,7 @@ end def % Define a reliable way of accessing FontDirectory in systemdict. /.FontDirectory { /FontDirectory .systemvar -} .bind odef +} .bind executeonly odef % Define a temporary string for local use, since using =string % interferes with some PostScript programs. @@ -88,6 +95,18 @@ userdict /.nativeFontmap .FontDirectory maxlength dict put {.readFontmap} 0 get 1 .quit } if % stack: dict file fontname filename|aliasname + dup type /nametype eq + { + dup (<<) cvn eq + { + pop mark + { + counttomark 2 add index token not {//false exit} if + dup (>>) cvn eq {pop //true exit} if + } loop + { .dicttomark }{cleartomark} ifelse + } if + } if 1 index type /stringtype eq 1 index type /nametype eq and 1 index xcheck and 1 index /run eq 2 index /.runlibfile eq or and { @@ -100,7 +119,7 @@ userdict /.nativeFontmap .FontDirectory maxlength dict put { 2 index token not { (Fontmap entry for ) print 1 index =only ( ends prematurely! Giving up.) = flush - {.loadFontmap} 0 get 1 .quit + {//.loadFontmap exec} 0 get 1 .quit } if dup /; eq { pop 3 index 3 1 roll .growput exit } if pop @@ -172,7 +191,7 @@ userdict /.nativeFontmap .FontDirectory maxlength dict put % .findfontvalue false % Closes the file in either case. exch dup read { - 2 copy unread 16#80 eq { + 2 copy .unread 16#80 eq { dup (xxxxxx) readstring pop pop % skip .PFB header } if { % Stack: key file @@ -191,7 +210,7 @@ userdict /.nativeFontmap .FontDirectory maxlength dict put % Stack: key file false dup { 4 } { 3 } ifelse -2 roll closefile pop } { closefile pop //false } ifelse -} bind def +} bind executeonly def /.findfontname { /FontName .findfontvalue } bind def @@ -202,6 +221,14 @@ NOFONTPATH { /FONTPATH () def } if { pop } { /FONTPATH (GS_FONTPATH) getenv not { () } if def } ifelse + +% The following are dummy definitions that, if we have a FONTPATH, will +% be replaced in the following section. +% They are here so immediately evaulation will work, and allow them to +% undefined at the bottom of the file. +/.scanfontbegin{} bind def +/.scanfontdir {} bind def + FONTPATH length 0 eq { (%END FONTPATH) .skipeof } if /FONTPATH [ FONTPATH .pathlist ] def @@ -242,12 +269,12 @@ FONTPATH length 0 eq { (%END FONTPATH) .skipeof } if /.scanfontbegin { % Construct the table of all file names already in Fontmap. currentglobal //true setglobal - .scanfontdict dup maxlength Fontmap length 2 add .max .setmaxlength + //.scanfontdict dup maxlength Fontmap length 2 add .max .setmaxlength Fontmap { exch pop { dup type /stringtype eq - { .splitfilename pop .fonttempstring copy .lowerstring cvn - .scanfontdict exch //true put + { //.splitfilename exec pop //.fonttempstring copy //.lowerstring exec cvn + //.scanfontdict exch //true put } { pop } @@ -280,9 +307,9 @@ FONTPATH length 0 eq { (%END FONTPATH) .skipeof } if /txt //true .dicttomark def /.scan1fontstring 8192 string def -% %%BeginFont: is not per Adobe documentation, but a few fonts have it. +% BeginFont: is not per Adobe documentation, but a few fonts have it. /.scanfontheaders [(%!PS-Adobe*) (%!FontType*) (%%BeginFont:*)] def -0 .scanfontheaders { length .max } forall 6 add % extra for PFB header +0 //.scanfontheaders { length .max } forall 6 add % extra for PFB header /.scan1fontfirst exch string def /.scanfontdir % .scanfontdir - { currentglobal exch //true setglobal @@ -291,16 +318,16 @@ FONTPATH length 0 eq { (%END FONTPATH) .skipeof } if 0 0 0 4 -1 roll % found scanned files { % stack: exch 1 add exch % increment filecount - dup .splitfilename .fonttempstring copy .lowerstring + dup //.splitfilename exec //.fonttempstring copy //.lowerstring exec % stack: % - .scanfontskip exch known exch .scanfontdict exch known or + //.scanfontskip exch known exch //.scanfontdict exch known or { pop % stack: } { 3 -1 roll 1 add 3 1 roll % stack: - dup (r) { file } .internalstopped + dup (r) { file } //.internalstopped exec { pop pop //null () % stack: % null () @@ -309,7 +336,7 @@ FONTPATH length 0 eq { (%END FONTPATH) .skipeof } if % On some platforms, the file operator will open directories, % but an error will occur if we try to read from one. % Handle this possibility here. - dup .scan1fontfirst { readstring } .internalstopped + dup //.scan1fontfirst { readstring } //.internalstopped exec { pop pop () } { pop } ifelse @@ -322,20 +349,22 @@ FONTPATH length 0 eq { (%END FONTPATH) .skipeof } if { dup length 6 sub 6 exch getinterval } if % Check for font file headers. - //false .scanfontheaders + //false //.scanfontheaders { 2 index exch .stringmatch or } forall exch pop { % stack: % - dup 0 setfileposition .findfontname + dup 0 setfileposition //.findfontname exec { dup .nativeFontmap exch known { pop pop } - { exch copystring exch + { exch + dup length string copy % copy string + exch DEBUG { ( ) print dup =only flush } if - 1 index .definenativefontmap - .splitfilename pop //true .scanfontdict 3 1 roll .growput + 1 index //.definenativefontmap exec + //.splitfilename exec pop //true //.scanfontdict 3 1 roll .growput % Increment fontcount. 3 -1 roll 1 add 3 1 roll } @@ -352,7 +381,7 @@ FONTPATH length 0 eq { (%END FONTPATH) .skipeof } if } ifelse } - .scan1fontstring filenameforall + //.scan1fontstring filenameforall QUIET { pop pop pop } { ( ) print =only ( files, ) print =only ( scanned, ) print @@ -361,7 +390,7 @@ FONTPATH length 0 eq { (%END FONTPATH) .skipeof } if ifelse pop setglobal - } bind def + } bind executeonly def %END FONTPATH @@ -374,7 +403,7 @@ FONTPATH length 0 eq { (%END FONTPATH) .skipeof } if /.setnativefontmapbuilt { % set whether we've been run dup type /booleantype eq { systemdict exch /.nativefontmapbuilt exch .forceput - } + } executeonly {pop} ifelse } .bind executeonly odef @@ -395,14 +424,14 @@ systemdict /NONATIVEFONTMAP known .setnativefontmapbuilt { % stack: [ (name) (path) ] % verify the font name ourselves - dup 1 get (r) { file } .internalstopped + dup 1 get (r) { file } //.internalstopped exec { % skip the entry if we can't open the returned path pop pop pop }{ % we could open the font file mark 2 1 roll - {.findfontname} .internalstopped + {//.findfontname exec} //.internalstopped exec { cleartomark pop @@ -413,16 +442,15 @@ systemdict /NONATIVEFONTMAP known .setnativefontmapbuilt % DEBUG { ( found ) print dup print (\n) print flush } if % add entry to the fontmap 1 index exch 0 exch dup type /nametype ne {cvn} if put - aload pop .definenativefontmap + aload pop //.definenativefontmap exec } ifelse } ifelse } forall } if % record that we've been run - //true .setnativefontmapbuilt + //true //.setnativefontmapbuilt } ifelse -} bind def -currentdict /.setnativefontmapbuilt .forceundef +} bind executeonly odef % Create the dictionary that registers the .buildfont procedure % (called by definefont) for each FontType. @@ -443,8 +471,8 @@ buildfontdict 3 /.buildfont3 cvx put % added entry, making sure there is at least one slot left for FID. dup maxlength 1 index length sub 2 lt { dup dup wcheck - { .growdict } - { .growdictlength dict .copydict } + { //.growdict exec} + { //.growdictlength exec dict .copydict } ifelse } { dup wcheck not { dup maxlength dict .copydict } if @@ -455,7 +483,7 @@ buildfontdict 3 /.buildfont3 cvx put { % Check for disabled platform fonts. NOPLATFONTS { % Make sure we leave room for FID. - .growfontdict dup /ExactSize 0 put + //.growfontdict exec dup /ExactSize 0 put } { % Hack: if the Encoding looks like it might be the % Symbol or Dingbats encoding, load those now (for the @@ -502,7 +530,7 @@ buildfontdict 3 /.buildfont3 cvx put } if readonly % stack: name fontdict } stopped { $error /command get /invalidfont signalerror } if -} bind def +} bind executeonly odef /definefont { dup rcheck not { /definefont cvx /invalidaccess signalerror @@ -512,21 +540,22 @@ buildfontdict 3 /.buildfont3 cvx put % the font in LocalFontDirectory. .currentglobal { //systemdict /LocalFontDirectory .knownget - { 2 index 2 index { .growput } systemdict /superexec known {//superexec}{1183615869 internaldict /superexec get exec} ifelse } % readonly + { 2 index 2 index .forceput } % readonly if } if - dup .FontDirectory 4 -2 roll { .growput } systemdict /superexec known {//superexec}{1183615869 internaldict /superexec get exec} ifelse % readonly + dup //.FontDirectory 4 -2 roll .forceput % readonly % If the font originated as a resource, register it. currentfile .currentresourcefile eq { dup .registerfont } if readonly - } odef + } .bind executeonly odef % Define a procedure for defining aliased fonts. % We use this only for explicitly aliased fonts, not substituted fonts: % we think this matches the observed behavior of Adobe interpreters. /.aliasfont % .aliasfont - { .currentglobal 3 1 roll dup .gcheck .setglobal + { + currentglobal 3 1 roll dup gcheck setglobal % dup length 2 add dict % dup 3 -1 roll % @@ -541,7 +570,7 @@ buildfontdict 3 /.buildfont3 cvx put % whose FontName is a local non-string, if someone passed a % garbage value to findfont. In this case, just don't % call definefont at all. - 2 index dup type /stringtype eq exch .gcheck or 1 index .gcheck not or + 2 index dup type /stringtype eq exch gcheck or 1 index gcheck not or { pop % 1 index dup type /stringtype eq { cvn } if % @@ -566,11 +595,12 @@ buildfontdict 3 /.buildfont3 cvx put % Don't bind in definefont, since Level 2 redefines it. /definefont .systemvar exec } - { /findfont cvx {.completefont} .errorexec pop exch pop + { + /findfont cvx {.completefont} //.errorexec exec pop exch pop } ifelse - exch .setglobal - } odef % so findfont will bind it + exch setglobal + } bind executeonly odef % so findfont will bind it % Define .loadfontfile for loading a font. If we recognize Type 1 and/or % TrueType fonts, gs_type1.ps and/or gs_ttf.ps will redefine this. @@ -669,10 +699,19 @@ buildfontdict 3 /.buildfont3 cvx put [(Cn) 4] [(Cond) 4] [(Narrow) 4] [(Pkg) 4] [(Compr) 4] [(Serif) 8] [(Sans) -8] ] readonly def + +/.fontnamestring { % .fontnamestring + dup type dup /nametype eq { + pop .namestring + } { + /stringtype ne { pop () } if + } ifelse +} bind def + /.fontnameproperties { % .fontnameproperties % - .fontnamestring - .substituteproperties { + //.fontnamestring exec + //.substituteproperties { 2 copy 0 get search { pop pop pop dup length 1 sub 1 exch getinterval 3 -1 roll exch { dup 0 ge { or } { neg not and } ifelse @@ -710,13 +749,7 @@ buildfontdict 3 /.buildfont3 cvx put % .nametostring dup type /nametype eq { .namestring } if } bind def -/.fontnamestring { % .fontnamestring - dup type dup /nametype eq { - pop .namestring - } { - /stringtype ne { pop () } if - } ifelse -} bind def + /.substitutefontname { % .substitutefontname % % Look for properties and/or a face name in the font name. @@ -724,7 +757,7 @@ buildfontdict 3 /.buildfont3 cvx put % base font; otherwise, use the default font. % Note that the "substituted" font name may be the same as % the requested one; the caller must check this. - exch .fontnamestring { + exch //.fontnamestring exec { defaultfontname /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique /Helvetica-Narrow /Helvetica-Narrow-Oblique /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique @@ -734,28 +767,28 @@ buildfontdict 3 /.buildfont3 cvx put } 3 1 roll % Stack: facelist properties fontname % Look for a face name. - .substitutefaces { + //.substitutefaces { 2 copy 0 get search { pop pop pop % Stack: facelist properties fontname [(pattern) family properties] dup 2 get 4 -1 roll or 3 1 roll - 1 get .substitutefamilies exch get + 1 get //.substitutefamilies exch get 4 -1 roll pop 3 1 roll } { pop pop } ifelse } forall pop 1 index length mod get exec -} bind def +} bind executeonly odef /.substitutefont { % .substitutefont - dup 0 exch .fontnameproperties .substitutefontname + dup 0 exch //.fontnameproperties exec .substitutefontname % Only accept fonts known in the Fontmap. Fontmap 1 index known not { .nativeFontmap 1 index known not {pop defaultfontname } if } if -} bind def +} bind executeonly odef % If requested, make (and recognize) fake entries in FontDirectory for fonts % present in Fontmap but not actually loaded. Thanks to Ray Johnston for @@ -814,7 +847,7 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if counttomark 1 sub { .aliasfont } repeat end % mark exch pop exch pop -} odef +} bind odef /findfont { .findfont } bind def @@ -860,7 +893,7 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if } { dup .substitutefont 2 copy eq { pop defaultfontname } if - .checkalias + //.checkalias exec QUIET not { SHORTERRORS { (%%[) print 1 index =only @@ -872,7 +905,7 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if } if } ifelse /Font findresource -} bind def +} bind executeonly def % Default font substitution does {pop /Courier} om many implementations. % GS post-process font substitution in .stdsubstfont and uses {} for @@ -886,8 +919,8 @@ $error /SubstituteFont { } put //null 0 1 FONTPATH length 1 sub { FONTPATH 1 index get //null ne { exch pop exit } if pop } for dup //null ne { - dup 0 eq { .scanfontbegin } if - FONTPATH 1 index get .scanfontdir + dup 0 eq { //.scanfontbegin exec} if + FONTPATH 1 index get //.scanfontdir exec FONTPATH exch //null put //true } { pop //false @@ -897,11 +930,10 @@ $error /SubstituteFont { } put % scanning of FONTPATH. /.dofindfont { % mark .dofindfont % mark ... .tryfindfont not { - % We didn't find the font. If we haven't scanned % all the directories in FONTPATH, scan the next one % now and look for the font again. - .scannextfontdir { + //.scannextfontdir exec { % Start over with an empty alias list. counttomark 1 sub { pop } repeat % mark .dofindfont @@ -927,6 +959,7 @@ $error /SubstituteFont { } put } if % Substitute for the font. Don't alias. % Same stack as at the beginning of .dofindfont. + $error /SubstituteFont get exec % % igorm: I guess the surrounding code assumes that .stdsubstfont @@ -935,104 +968,24 @@ $error /SubstituteFont { } put % used in .dofindfont and through .stdsubstfont % just to represent a simple iteration, % which accumulates the aliases after the mark. - .stdsubstfont + //.stdsubstfont exec } ifelse } ifelse } if -} bind def -% Try to find a font using only the present contents of Fontmap. -/.tryfindfont { % .tryfindfont true - % .tryfindfont false - .FontDirectory 1 index .fontknownget - { % Already loaded - exch pop //true - } - { - dup Fontmap exch .knownget - { //true //true } - { % Unknown font name. Look for a file with the - % same name as the requested font. - dup .tryloadfont - { exch pop //true //false } - { - % if we can't load by name check the native font map - dup .nativeFontmap exch .knownget - { //true //true } - { //false //false } ifelse - } ifelse - } ifelse - - { % Try each element of the Fontmap in turn. - pop - //false exch % (in case we exhaust the list) - % Stack: fontname false fontmaplist - { exch pop - dup type /nametype eq - { % Font alias - .checkalias .tryfindfont exit - } - { dup dup type dup /arraytype eq exch /packedarraytype eq or exch xcheck and - { % Font with a procedural definition - exec % The procedure will load the font. - % Check to make sure this really happened. - .FontDirectory 1 index .knownget - { exch pop //true exit } - if - } - { % Font file name - //true .loadfontloop { //true exit } if - } - ifelse - } - ifelse //false - } - forall - % Stack: font true -or- fontname false - { //true - } - { % None of the Fontmap entries worked. - % Try loading a file with the same name - % as the requested font. - .tryloadfont - } - ifelse - } - if - } - ifelse - } bind def +} bind executeonly def % any user of .putgstringcopy must use bind and executeonly /.putgstringcopy % .putgstringcopy - { 2 index gcheck currentglobal 2 copy eq { pop pop .forceput - } { + } executeonly { 5 1 roll setglobal dup length string copy .forceput setglobal - } ifelse + } executeonly ifelse } .bind executeonly odef % must be bound and hidden for .forceput -% Attempt to load a font from a file. -/.tryloadfont { % .tryloadfont true - % .tryloadfont false - dup .nametostring - % Hack: check for the presence of the resource machinery. - /.genericrfn where { - pop - pop dup .fonttempstring /FontResourceDir getsystemparam .genericrfn - {//false .loadfontloop} .internalstopped {//false} if { - //true - } { - dup .nametostring - {//true .loadfontloop} .internalstopped {//false} if - } ifelse - } { - {//true .loadfontloop} .internalstopped {//false} if - } ifelse -} bind def - /.loadfontloop { % .loadfontloop % true % -or- @@ -1081,11 +1034,11 @@ $error /SubstituteFont { } put % because it's different depending on language level. .currentglobal exch /.setglobal .systemvar exec % Remove the fake definition, if any. - .FontDirectory 3 index .forceundef % readonly - 1 index (r) file .loadfont .FontDirectory exch + //.FontDirectory 3 index .forceundef % readonly + 1 index (r) file .loadfont //.FontDirectory exch /.setglobal .systemvar exec - } - { .loadfont .FontDirectory + } executeonly + { .loadfont //.FontDirectory } ifelse % Stack: fontname fontfilename fontdirectory @@ -1102,25 +1055,25 @@ $error /SubstituteFont { } put } if % Check to make sure the font was actually loaded. - dup 3 index .fontknownget - { dup /PathLoad 4 index .putgstringcopy + dup 3 index //.fontknownget exec + { dup /PathLoad 4 index //.putgstringcopy 4 1 roll pop pop pop //true exit - } if + } executeonly if % Maybe the file had a different FontName. % See if we can get a FontName from the file, and if so, % whether a font by that name exists now. exch dup % Stack: origfontname fontdirectory path path - (r) file .findfontname + (r) file //.findfontname exec { % Stack: origfontname fontdirectory path filefontname - 2 index 1 index .fontknownget + 2 index 1 index //.fontknownget exec { % Yes. Stack: origfontname fontdirectory path filefontname fontdict - dup 4 -1 roll /PathLoad exch .putgstringcopy + dup 4 -1 roll /PathLoad exch //.putgstringcopy % Stack: origfontname fontdirectory filefontname fontdict 3 -1 roll pop % Stack: origfontname filefontname fontdict - dup /FontName get dup FontDirectory exch .forceundef - GlobalFontDirectory exch .forceundef + dup /FontName get dup //.FontDirectory exch .forceundef + /GlobalFontDirectory .systemvar exch .forceundef dup length dict .copydict dup 3 index /FontName exch put 2 index exch definefont exch @@ -1134,9 +1087,9 @@ $error /SubstituteFont { } put ifelse % Stack: origfontname fontdict exch pop //true exit % Stack: fontdict - } + } executeonly if pop % Stack: origfontname fontdirectory path - } + } executeonly if pop pop % Stack: origfontname % The font definitely did not load correctly. @@ -1150,7 +1103,111 @@ $error /SubstituteFont { } put } bind executeonly odef % must be bound and hidden for .putgstringcopy -currentdict /.putgstringcopy .undef +% Attempt to load a font from a file. +/.tryloadfont { % .tryloadfont true + % .tryloadfont false + dup //.nametostring exec + % Hack: check for the presence of the resource machinery. + /.genericrfn where { + pop + pop dup //.fonttempstring /FontResourceDir getsystemparam .genericrfn + {//false .loadfontloop} //.internalstopped exec {//false} if { + //true + } { + dup //.nametostring exec + {//true .loadfontloop} //.internalstopped exec {//false} if + } ifelse + } { + {//true .loadfontloop} //.internalstopped exec {//false} if + } ifelse +} bind def + +% Try to find a font using only the present contents of Fontmap. +/.tryfindfont { % .tryfindfont true + % .tryfindfont false + //.FontDirectory 1 index //.fontknownget exec + { % Already loaded + exch pop //true + } + { + dup Fontmap exch .knownget + { //true //true } + { % Unknown font name. Look for a file with the + % same name as the requested font. + dup //.tryloadfont exec + { exch pop //true //false } + { + % if we can't load by name check the native font map + dup .nativeFontmap exch .knownget + { //true //true } + { //false //false } ifelse + } ifelse + } ifelse + + { % Try each element of the Fontmap in turn. + pop + //false exch % (in case we exhaust the list) + % Stack: fontname false fontmaplist + { exch pop + dup type /nametype eq + { % Font alias + //.checkalias exec + dup .tryfindfont + { + % We don't want to reuse an embedded font as a substitute + % so make sure the font came from disk before using it. + dup /Path known + 1 index /PathLoad known or + { exch pop //true exit } + { + % if the candidate didn't come from disk, remove it from + % FontDirectory and try again. + pop dup undefinefont + .tryfindfont exit + } + ifelse + } if + } + { dup dup type dup /arraytype eq exch /packedarraytype eq or exch xcheck and + { % Font with a procedural definition + exec % The procedure will load the font. + % Check to make sure this really happened. + //.FontDirectory 1 index .knownget + { exch pop //true exit } + if + } + { % Font file name + dup type /dicttype eq + { + begin + Path + } + { + 1 dict begin + } ifelse + //true .loadfontloop + end + { //true exit } if + } + ifelse + } + ifelse //false + } + forall + % Stack: font true -or- fontname false + { //true + } + { % None of the Fontmap entries worked. + % Try loading a file with the same name + % as the requested font. + //.tryloadfont exec + } + ifelse + } + if + } + ifelse + } bind executeonly def % Define a procedure to load all known fonts. % This isn't likely to be very useful. @@ -1176,25 +1233,25 @@ currentdict /.putgstringcopy .undef { { pop dup type /stringtype eq { cvn } if - .FontDirectory 1 index known not { + //.FontDirectory 1 index known not { 2 dict dup /FontName 3 index put dup /FontType 1 put - .FontDirectory 3 1 roll { put } systemdict /superexec known {//superexec}{1183615869 internaldict /superexec get exec} ifelse % readonly + //.FontDirectory 3 1 roll //.forceput exec % readonly } { pop } ifelse } forall } forall - } + } executeonly % hide .forceput FAKEFONTS { exch } if pop def % don't bind, .current/setglobal get redefined % Install initial fonts from Fontmap. /.loadinitialfonts { NOFONTMAP not { /FONTMAP where - { pop [ FONTMAP .pathlist ] + { pop [ FONTMAP //.pathlist exec] { dup VMDEBUG findlibfile - { exch pop .loadFontmap } + { exch pop //.loadFontmap exec } { /undefinedfilename signalerror } ifelse } @@ -1204,11 +1261,11 @@ FAKEFONTS { exch } if pop def % don't bind, .current/setglobal get redefined //false .file_name_combine { dup VMDEBUG - (r) { file } .internalstopped { + (r) { file } //.internalstopped exec { pop pop defaultfontmap_content { .definefontmap } forall } { - .loadFontmap + //.loadFontmap exec } ifelse } { pop pop @@ -1219,56 +1276,21 @@ FAKEFONTS { exch } if pop def % don't bind, .current/setglobal get redefined } if userdict /defaultfontmap_content .undef - .definefakefonts % current VM is global + //.definefakefonts exec % current VM is global } def % don't bind, .current/setglobal get redefined -% ---------------- Synthetic font support ---------------- % - -% Create a new font by modifying an existing one. paramdict contains -% entries with the same keys as the ones found in a Type 1 font; -% it should also contain enough empty entries to allow adding the -% corresponding non-overridden entries from the original font dictionary, -% including FID. If paramdict includes a FontInfo entry, this will -% also override the original font's FontInfo, entry by entry; -% again, it must contain enough empty entries. - -% Note that this procedure does not perform a definefont. - -/.makemodifiedfont % .makemodifiedfont - { exch - { % Stack: destdict key value - 1 index /FID ne - { 2 index 2 index known - { % Skip fontdict entry supplied in paramdict, but - % handle FontInfo specially. - 1 index /FontInfo eq - { 2 index 2 index get % new FontInfo - 1 index % old FontInfo - { % Stack: destdict key value destinfo key value - 2 index 2 index known - { pop pop } - { 2 index 3 1 roll put } - ifelse - } - forall pop - } - if - } - { % No override, copy the fontdict entry. - 2 index 3 1 roll put - dup dup % to match pop pop below - } - ifelse - } - if - pop pop - } forall - } bind def - -% Make a modified font and define it. Note that unlike definefont, -% this does not leave the font on the operand stack. - -/.definemodifiedfont % .definemodifiedfont - - { .makemodifiedfont - dup /FontName get exch definefont pop - } bind def +% Undef these, not needed outside this file +[ + % /.fonttempstring /.scannextfontdir - are also used in gs_res.ps, so are undefined there + % /.scanfontheaders - used in gs_cff.ps, gs_ttf.ps + /.loadfontloop /.tryloadfont /.findfont /.pathlist /.loadFontmap /.lowerstring + /.splitfilename /.scanfontdict /.scanfontbegin + /.scanfontskip /.scan1fontstring + /.scan1fontfirst /.scanfontdir + /.setnativefontmapbuilt /.aliasfont + /.setloadingfont /.substitutefaces /.substituteproperties /.substitutefamilies + /.nametostring /.fontnamestring /.checkalias /.fontknownget /.stdsubstfont + /.putgstringcopy + /.definenativefontmap + /.findfontname +] {systemdict exch .forceundef} forall diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_frsd.ps b/Master/tlpkg/tlgs/Resource/Init/gs_frsd.ps index 49ea61062b1..c4ed1cb0b5e 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_frsd.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_frsd.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -46,7 +46,7 @@ level2dict begin % If AsyncRead is true, try to create the filter directly. % Stack: dict filters parms CloseSource source 4 index /AsyncRead .knownget not { //false } if { - 1 index { .reusablestream } .internalstopped + 1 index { .reusablestream } //.internalstopped exec } { //null //true } ifelse { diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_icc.ps b/Master/tlpkg/tlgs/Resource/Init/gs_icc.ps index 4ff59c6ef7d..6a4e88a0f73 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_icc.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_icc.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -103,6 +103,8 @@ dup //null eq {pop {pop pop}} if /exec load 4 array astore cvx readonly << /ProcessDSCComment 3 -1 roll >> setuserparams +currentdict /.ProcessICCcomment .undef + end % systemdict %END PSICC .setglobal diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_il1_e.ps b/Master/tlpkg/tlgs/Resource/Init/gs_il1_e.ps index 99933c8a1e1..3de6ab5c950 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_il1_e.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_il1_e.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_img.ps b/Master/tlpkg/tlgs/Resource/Init/gs_img.ps index 273c18b10dd..be1dc8fd298 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_img.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_img.ps @@ -46,7 +46,7 @@ % implemented in this file as well. % % In this implementation, all sampled objects are passed through one of -% the internal operators .image1, .imagemask1, .image1alpha, .image2, +% the internal operators .image1, .imagemask1, .image2, % .image3, or .image4, each of which handles a specific ImageType value. % % The procedures in this file are responsible for constructing @@ -115,22 +115,6 @@ def 5 dict dup 1 /.imagemask1 load put def -end -.setglobal - -% -% Build a dictionary of utility procedures and constants for use in -% impelementing the image operators. This dictionary is in global VM but -% is maintained (during initialization) in userdict. It should be pushed -% onto the dictionary stack when constructing image-related procedures -% and pseudo-operators. -% -% This dictionary is removed from userdict when initialization is -% completed. -% -.currentglobal //true .setglobal -userdict /img_utils_dict 30 dict put -img_utils_dict begin % % Some useful local data structures: @@ -318,56 +302,49 @@ def % % ... -% +% % img_build_image_dict -% +% % % Build the dictionary corresponding to a colorimage operand stack. This % routine will check just enough of the stack to verify that the % dictionary can be built, and will generate the appropriate error if this % is not the case. % -% The boolean is used to support the Next alphaimage extension. -% % At the first level, errors in this procedure are reported as colorimage % errors. The error actually reported will usually be determined by the % pseudo-operator which invokes this routine. % /img_build_image_dict { - % Veify that at least 8 operands are available, and that the top three + % Verify that at least 7 operands are available, and that the top two % operands have the expected types - count 8 lt + count 7 lt { /.colorimage cvx /stackunderflow signalerror } if - 3 copy - type /booleantype ne exch - type /integertype ne or exch + 2 copy + type /integertype ne exch type /booleantype ne or { /.colorimage cvx /typecheck signalerror } if % verify that the number of components is 1, 3, or 4 - 1 index 1 lt 2 index 2 eq or 2 index 4 gt or + dup 1 lt 1 index 2 eq or 1 index 4 gt or { /.colorimage cvx /rangecheck signalerror } if % Verify that the required number of operands are present if multiple % data sources are being used. If this test is successful, convert % the data sources to an array (in local VM). - 2 index + 1 index { - % if an alpha component is present, this adds one more component - 2 copy - { 1 add } - if - dup count 9 sub gt - { + dup dup count 8 sub gt + { % Adobe interpreters appear to test the arguments sequentially % starting from the top of the stack and report the 1st error found. % To satisfy CET test 12-02.PS we emulate this logic. //true exch -1 1 - { 3 add index + { 2 add index //good_image_types 1 index type .knownget { exec and } @@ -388,14 +365,14 @@ def % build the DataSource array in local VM dup .currentglobal //false .setglobal exch array exch .setglobal - % stack: ... - 5 1 roll 4 add 3 roll astore 4 1 roll + % stack: ... + 4 1 roll 3 add 2 roll astore 3 1 roll } if % the image dictionary can be built; do so - % stack: - 8 1 roll //img_params_ary //img_build_dict exec exch + % stack: + //img_params_ary //img_build_dict exec } .bind def currentdict /good_image_types .undef @@ -408,8 +385,7 @@ currentdict /good_image_types .undef % % If the top entry of the stack is a dictionary that has the keys required % by a colorimage dictionary, unpack that dictionary onto the stack. -% Otherwise just leave things as they are. Note that the -% parameter is not pushd onto the stack. +% Otherwise just leave things as they are. % /img_unbuild_image_dict { @@ -482,29 +458,26 @@ currentdict /good_image_types .undef % % ... -% +% % .colorimage % - % % Convert the image/colorimage operator from their traditional form to -% the dictionary form. The operand is used ot support the -% Next alphaimage extension. +% the dictionary form. % % Error handling for these operators is a bit complex, due to the stack % handling required of operators that potentially invoke procedures. % This problem is discussed in the comment above. The facts relevant to % this particular implementation are: % -% 1. The .image1 (or .alphaimage) operator is executed in a stopped +% 1. The .image1 operator is executed in a stopped % context, so that we can undo the gsave context in the event of % an error. % % 2. In the event of an error, the stack is examined to see if the -% dictionary passed to .image1 (.alphaimage) is still present. +% dictionary passed to .image1 is still present. % If so, this dictionary is "unpacked" onto the stack to re- -% create the original stack. The parameter is not -% pushed onto the stack, as it is not required for any of the -% pseudo-operators than invoke this procedure. +% create the original stack. % % 3. The use of pseudo-operators in this case may yield incorrect % results for late-detected errors, as the stack depth will be @@ -522,14 +495,12 @@ currentdict /good_image_types .undef gsave % The CET test file 12-02.ps creates colorimages with a width and % height of 0. Ignore these since that is what the CET expects. - 1 index dup /Height get 0 eq exch /Width get 0 eq or - { pop pop } % Ignore colorimage. Pop bool and dict + dup dup /Height get 0 eq exch /Width get 0 eq or + { pop } % Ignore colorimage. Pop dict { 0 .setoverprintmode % disable overprint mode for images - //img_csary 2 index /IMG_NComps get get setcolorspace - { .alphaimage } - { .image1 } - ifelse + //img_csary 1 index /IMG_NComps get get setcolorspace + .image1 } ifelse } @@ -558,7 +529,6 @@ systemdict /setcolorscreen .knownget { /colorimage { - //false //.colorimage stopped { /colorimage .systemvar $error /errorname get signalerror } @@ -656,7 +626,7 @@ if ifelse } { - //false 1 //false + //false 1 //.colorimage stopped { /image .systemvar $error /errorname get signalerror } @@ -664,7 +634,7 @@ if } ifelse } -.bind systemdict begin odef end +.bind odef % An auxiliary function for checking whether an imagemask to be interpolated. /.is_low_resolution % .is_low_resolution @@ -677,7 +647,7 @@ if 4 1 roll idtransform dtransform dup mul exch dup mul add sqrt } repeat - max + .max 2 gt % arbitrary } .bind def @@ -742,8 +712,31 @@ if } ifelse } -.bind systemdict begin odef end - -end % img_utils_dict +.bind odef + +% undefine a bunch of local definitions +[ + /.colorimage + /img_params_dict + /img_unbuild_dict + /img_unbuild_image_dict + /img_unbuild_imagemask_dict + /img_build_dict + /img_build_image_dict + /img_build_imagemask_dict + /img_check_keys + /img_mask_check_ary + /img_params_ary + /img_mask_unbuild_ary + /img_mask_params_ary + /img_csary + /img_decary + /img_check_ary + /img_unbuild_ary + /.is_low_resolution +] +{currentdict exch .undef} forall + +end % systemdict .setglobal % restore VM mode diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_init.ps b/Master/tlpkg/tlgs/Resource/Init/gs_init.ps index d733124b96d..55a785eceed 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_init.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_init.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -34,7 +34,7 @@ % Interpreter library version number % NOTE: the interpreter code requires that the first non-comment token % in this file be an integer, and that it match the compiled-in version! -926 +927 % Check the interpreter revision. dup revision ne @@ -54,18 +54,11 @@ systemdict exch dup /userdict currentdict dup 200 .setmaxlength % userdict .forceput % userdict is local, systemdict is global - } + } executeonly if begin -% Define dummy local/global operators if needed. -systemdict /.setglobal known - { //true .setglobal - } - { /.setglobal { pop } bind def - /.currentglobal { //false } bind def - /.gcheck { pop //false } bind def - } -ifelse +% Init to global memory (possibly not needed, but left in for legacy purposes) +//true .setglobal % Define .languagelevel if needed. systemdict /.languagelevel known not { /.languagelevel 1 def } if @@ -116,7 +109,7 @@ currentdict /PDFSTEP known /PDFSTEP exch def PDFSTEP { /PDFDEBUG //true def } if currentdict /PDFSTOPONERROR known /PDFSTOPONERROR exch def -currentdict /PDFSTOPONWARNING known {/PDFSTOPONWARNING true def /PDFSTOPONERROR true def}{/PDFSTOPONWARNING false def} ifelse +currentdict /PDFSTOPONWARNING known {/PDFSTOPONWARNING //true def /PDFSTOPONERROR //true def}{/PDFSTOPONWARNING //false def} ifelse currentdict /PDFNOCIDFALLBACK known /PDFNOCIDFALLBACK exch def /.bind /bind load def @@ -147,7 +140,7 @@ currentdict /PDFNOCIDFALLBACK known /PDFNOCIDFALLBACK exch def % ancient and no longer maintained piece of softare, did check % its value unconditionally. So we retain this key in the dictionary % purely for backward compatibility. -/NOBIND false def +/NOBIND //false def currentdict /BATCH known /BATCH exch def currentdict /DELAYBIND known /DELAYBIND exch def @@ -212,12 +205,9 @@ currentdict /SCANCONVERTERTYPE known currentdict /SCANCONVERTERTYPE get .setscanconverter } if -% We rely on PSFitPage to actually implement EPSFitPage -% But we need EPSCrop to be true, to actually issue a PageSize request, so set it here -% in case the user forgets. -currentdict /EPSFitPage known { /PSFitPage //true def /EPSCrop //true def} if +currentdict /EPSFitPage known { /PSFitPage //true def } if % This is a "convenience" option that sets a combination of EPSFitPage, PDFFitPage and PSFitPage -currentdict /FitPage known { /EPSFitPage //true def /EPSCrop //true def /PDFFitPage //true def /PSFitPage //true def } if +currentdict /FitPage known { /EPSFitPage //true def /PDFFitPage //true def /PSFitPage //true def } if % Acquire environment variables. currentdict /DEVICE known not @@ -271,7 +261,7 @@ userdict /=string 256 string put { mark product (GPL Ghostscript) search { pop pop pop - (This software comes with NO WARRANTY: see the file PUBLIC for details.\n) + (This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:\nsee the file COPYING for details.\n) } { pop } @@ -289,7 +279,8 @@ userdict /=string 256 string put } repeat pop } .bind def -QUIET not { printgreeting flush } if +QUIET not { //printgreeting exec flush } if +currentdict /printgreeting .undef % Define a special version of def for making operator procedures. /obind { % obind @@ -299,27 +290,20 @@ QUIET not { printgreeting flush } if 1 index exch .makeoperator def } .bind def -% Define a special version of def for storing local objects into global -% dictionaries. Like .forceput, this exists only during initialization. -/.forcedef { % .forcedef - - 1 .argindex pop % check # of args - currentdict 3 1 roll .forceput -} .bind odef - % Define procedures for accessing variables in systemdict and userdict % regardless of the contents of the dictionary stack. /.systemvar { % .systemvar //systemdict exch get -} .bind odef +} .bind executeonly odef /.systemexec { .systemvar exec -} .bind odef +} .bind executeonly odef /.userdict { % - .userdict /userdict .systemvar -} .bind odef +} .bind executeonly odef /.uservar { % .uservar .userdict exch get -} .bind odef +} .bind executeonly odef % If we're delaying binding, remember everything that needs to be bound later. DELAYBIND @@ -347,7 +331,7 @@ DELAYBIND } ifelse } .bind def -} if +} executeonly if %**************** BACKWARD COMPATIBILITY **************** /hwsizedict mark /HWSize //null .dicttomark readonly def @@ -360,6 +344,9 @@ currentdict /hwsizedict .undef /getdeviceprops { //null .getdeviceparams } bind odef + +% NOTE: Note sure why/if this needs to be a separate operator. Consider rolling this +% implementation into /putdeviceprops ? /.putdeviceprops { //null //true counttomark 1 add 3 roll .putdeviceparams dup type /booleantype ne @@ -368,15 +355,14 @@ currentdict /hwsizedict .undef /.putdeviceprops .systemvar exch signalerror } if - } bind odef -/.currentfilladjust { .currentfilladjust2 pop } bind odef -/.setfilladjust { dup .setfilladjust2 } bind odef + } bind executeonly odef /.writecvs { 0 .writecvp } bind odef + %**************** DEPRECATED PROCEDURES **************** %**************** DO NOT USE THESE IN NEW CODE **************** +% Keeping these because they have been around a long time and we don't want to break old code that's out in the wild /max { .max } bind def % use .max instead /min { .min } bind def % use .min instead -/unread /.unread load def % use .peekstring instead %**************** END OF BACKWARD COMPATIBILITY SECTION **************** % Utility for removing all entries from a dictionary @@ -400,19 +386,19 @@ userdict /#copies 1 put /mark load def (]) cvn {counttomark array astore exch pop} odef -% .beginpage is redefined if setpagedevice is present. -/.beginpage { } odef -% In LanguageLevel 3, copypage erases the page. -/copypage { - .languagelevel 3 ge - dup { 0 } { 1 } ifelse .endpage .doneshowpage { - .currentnumcopies 1 index .outputpage - (>>copypage, press to continue<<\n) .confirm - dup { erasepage } if - } if pop - systemdict /..page_default_spaces .knownget { //.PurgeDict exec } if - .beginpage -} odef +% +% - initgraphics - +% +% Although the internal routine gs_initgraphics resets the color space, +% it does not reset the color space we store in the 'interpreter' +% graphics state (so that we can hand it back in currentcolorspace). +% So we need to do that in the PostScript world. +% +% +/initgraphics + { initgraphics systemdict /DeviceGray_array get setcolorspace } +.bind executeonly odef + /currentmatrix { dup type /arraytype ne { /currentmatrix load /typecheck signalerror } if @@ -420,8 +406,52 @@ userdict /#copies 1 put { /currentmatrix load /rangecheck signalerror } if .currentmatrix 6 .argindex astore pop } odef -% .currentnumcopies is redefined in Level 2. -/.currentnumcopies { #copies } odef + +% We have to guard against the BeginPage procedure not popping its operand. +% This is really stupid, but the Genoa CET does it. +/.beginpage { % - .beginpage - + .currentshowpagecount { + .currentpagedevice pop + dup //null ne { /BeginPage .knownget } { pop //false } ifelse { + % Stack: ... pagecount proc + count 2 .execn + % Stack: ... ..???.. oldcount + count 1 add exch sub { pop } repeat + } { + pop + } ifelse + } if +} .bind executeonly odef + +% Guard similarly against EndPage not popping its operand. +/.endpage { % .endpage + .currentshowpagecount { + 1 index .currentpagedevice pop + dup //null ne { /EndPage .knownget } { pop //false } ifelse { + % Stack: ... reason pagecount reason proc + count 2 .execn + % Stack: ... ..???.. print oldcount + count 2 add exch sub { exch pop } repeat + } { + pop pop 2 ne + } ifelse + } { + 2 ne + } ifelse +} .bind executeonly odef + +% Define .currentnumcopies so it consults the NumCopies device parameter. +/.numcopiesdict mark + /NumCopies dup +.dicttomark readonly def +/.currentnumcopies + { currentdevice //.numcopiesdict .getdeviceparams + dup type /integertype eq + { exch pop exch pop } + { cleartomark #copies } + ifelse +} .bind executeonly odef + /setcolorscreen where { pop % not in all Level 1 configurations /currentcolorscreen { .currenthalftone @@ -456,8 +486,6 @@ userdict /.echo.mode //true put % because this is apparently what Adobe interpreters do. currentdict //systemdict eq { end } if } odef -% .endpage is redefined if setpagedevice is present. -/.endpage { 2 ne } odef % erasepage mustn't use gsave/grestore, because we call it before % the graphics state stack has been fully initialized. /erasepage @@ -472,24 +500,48 @@ userdict /.echo.mode //true put currentoverprint //false setoverprint 1 setgray .fillpage setoverprint exec } odef +% Define a procedure for clearing the error indication. +/.clearerror + { $error /newerror //false put + $error /errorname //null put + $error /errorinfo //null put + 0 .setoserrno + } bind executeonly def + % To satisfy the Genoa FTS, executive must be a procedure, not an operator. +% Define the procedure used by .runfile, .runstdin and .runstring +% for executing user input. +% This is called with a procedure or executable file on the operand stack. +/.execute { % .execute + stopped $error /newerror get and + { /handleerror .systemvar exec flush //true } { //false } ifelse +} bind def +% Define an execute analogue of runlibfile0. +/execute0 { % execute0 - + //.execute exec { /execute0 cvx 1 .quit } if +} bind def /executive { { prompt { (%statementedit) (r) .systemvmfile } stopped { pop pop $error /errorname get /undefinedfilename eq - { .clearerror exit } if % EOF + { //.clearerror exec exit } if % EOF /handleerror .systemvar exec //null % ioerror?? } if - cvx { .runexec } .execute pop + cvx { .runexec } //.execute exec pop } loop } bind def +currentdict /.execute .undef + /filter { //filterdict 1 .argindex .knownget { exch pop exec } { /filter .systemvar /undefined signalerror } ifelse } odef +% Internal uses of stopped that aren't going to do a stop if an error occurs +% should use .internalstopped to avoid setting newerror et al. +/.internalstopped { //null 1 .stopped //null ne } bind executeonly def % handleerror procedure as mentioned in the "Operators" section of the PLRM Section 8.2 % This invokes the handleerror procedure from errordict (unless we are running under a % JOBSERVER where we want to always use a defined error handler (many error handlers in @@ -499,9 +551,9 @@ userdict /.echo.mode //true put % won't cause nested errors (Unexpected Error conditions). /handleerror JOBSERVER { - { /.GShandleerror .systemvar .internalstopped pop } bind % always use .GShandleerror. + { /.GShandleerror .systemvar //.internalstopped exec pop } bind % always use .GShandleerror. } { - { /errordict .systemvar /handleerror get .internalstopped pop } bind % PLRM standard errorhandling + { /errordict .systemvar /handleerror get //.internalstopped exec pop } bind % PLRM standard errorhandling } ifelse def /identmatrix [1.0 0.0 0.0 1.0 0.0 0.0] readonly def /identmatrix { @@ -512,16 +564,18 @@ userdict /.echo.mode //true put /languagelevel 1 def % gs_lev2.ps may change this /makeimagedevice { //false makewordimagedevice } odef /matrix { 6 array identmatrix } odef -% .promptmsg is redefined if the interpreter includes readline support. + /.promptmsg { (GS) print count 0 ne { (<) print count =only } if (>) print flush } bind def -/prompt { flush flushpage NOPROMPT not { .promptmsg } if } bind def +/prompt { flush flushpage NOPROMPT not { //.promptmsg exec} if } bind def +currentdict /.promptmsg .undef + /pstack { 0 1 count 3 sub { index == } for } bind def /putdeviceprops - { .putdeviceprops { erasepage } if } odef + { .putdeviceprops { erasepage } if } bind executeonly odef /quit { /quit load 0 .quit } odef /run { dup type /filetype ne { (r) .systemvmfile } if % We must close the file when execution terminates, @@ -543,7 +597,7 @@ userdict /.echo.mode //true put % startjob replaces the null on the o-stack with a procedure % to be executed when we get back here. dup //null ne { exec //true } { pop //false } ifelse -} bind def +} bind executeonly def /.runexec2 { % .runexec2 - exch { .runexec @@ -598,10 +652,48 @@ odef dup length 6 ne { /setmatrix load /rangecheck signalerror } if dup aload pop .setmatrix pop } odef + +/.confirmread { + TTYPAUSE { + (/dev/tty) (r) file dup read pop pop closefile + } { + .echo.mode //false echo + (%stdin) (r) file dup read { + dup (\n) 0 get eq { pop pop } { .unread } ifelse + } { + pop + } ifelse echo + } ifelse +} bind executeonly def + +/.confirm { + DISPLAYING NOPAUSE not TTYPAUSE or and { + % Print a message (unless NOPAGEPROMPT or NOPROMPT is true) + % and wait for the user to type something. + % If the user just types a newline, flush it. + NOPAGEPROMPT NOPROMPT or { pop } { print flush } ifelse + //.confirmread exec + } { + pop + } ifelse +} bind executeonly def + +% In LanguageLevel 3, copypage erases the page. +/copypage { + .languagelevel 3 ge + dup { 0 } { 1 } ifelse .endpage .doneshowpage { + .currentnumcopies 1 index .outputpage + (>>copypage, press to continue<<\n) //.confirm exec + dup { erasepage } if + } if pop + systemdict /..page_default_spaces .knownget { //.PurgeDict exec } if + .beginpage +} .bind executeonly odef + /showpage { 0 .endpage .doneshowpage { .currentnumcopies //true .outputpage - (>>showpage, press to continue<<\n) .confirm + (>>showpage, press to continue<<\n) //.confirm exec % Uncomment the following line, and use a Memento build to track % blocks that are created and not destroyed between each successive % page. @@ -614,14 +706,12 @@ odef { initgraphics } ifelse systemdict /..page_default_spaces .knownget { //.PurgeDict exec } if .beginpage -} odef +} .bind executeonly odef + % Code output by Adobe Illustrator relies on the fact that % `stack' is a procedure, not an operator!!! /stack { 0 1 count 3 sub { index = } for } bind def /start { BATCH { //null 0 .quit } { executive } ifelse } def -% Internal uses of stopped that aren't going to do a stop if an error occurs -% should use .internalstopped to avoid setting newerror et al. -/.internalstopped { //null 1 .stopped //null ne } bind def /store { % Don't alter operands before completing. 1 .argindex where { 2 index 2 index put pop pop } { def } ifelse } odef @@ -642,8 +732,6 @@ currentdict /.typenames .undef % internaldict is defined in systemdict, but the dictionary is allocated % in local VM. However, the procedure must be global, since it is an % "operator" and must be bind-able into global procedures. -% We make a procedure for creating it, since we must create a new one -% for each context with private local VM. /.makeinternaldict { .currentglobal //true .setglobal [ /dup .systemvar 1183615869 /eq .systemvar @@ -655,9 +743,10 @@ currentdict /.typenames .undef /ifelse .systemvar ] cvx executeonly exch .setglobal -} odef +} executeonly def systemdict /internaldict dup .makeinternaldict .makeoperator .forceput % proc is local, systemdict is global +currentdict /.makeinternaldict .undef % Define some additional built-in procedures (beyond the ones defined by % the PostScript Language Reference Manual). @@ -673,8 +762,6 @@ systemdict /internaldict dup .makeinternaldict .makeoperator % Copy a dictionary per the Level 2 spec even in Level 1. /.copydict % .copydict { dup 3 -1 roll { put dup } forall pop } bind def -/copystring - { dup length string copy } bind def /findlibfile { .systemvmlibfile { dup .filename pop exch //true } { //false } ifelse } odef @@ -682,11 +769,11 @@ systemdict /internaldict dup .makeinternaldict .makeoperator { length 3 mul 2 idiv 1 add } bind def /.growdict % grow a dictionary - { dup .growdictlength .setmaxlength + { dup //.growdictlength exec .setmaxlength } bind def /.growput % put, grow the dictionary if needed { 2 index length 3 index maxlength eq - { 3 copy pop known not { 2 index .growdict } if + { 3 copy pop known not { 2 index //.growdict exec} if } if put } bind def @@ -709,8 +796,6 @@ systemdict /internaldict dup .makeinternaldict .makeoperator } ifelse /.packtomark { counttomark packedarray exch pop } bind def -/ppstack - { 0 1 count 3 sub { index === } for } bind def /runlibfile { % We don't want to bind 'run' into this procedure, % since run may get redefined. @@ -777,13 +862,13 @@ userdict /.currentresourcefile //null put 2 .execn % stopped .userdict /.currentresourcefile 3 -1 roll put { stop } if -} bind def +} bind executeonly def /.runresource { % .runresource - { /run .systemvar exec } .execasresource } bind def -% Define auxiliary procedures needed for the above. -/shellarguments % -> shell_arguments true (or) false +% Convenience function (documented extension) +/.shellarguments % -> shell_arguments true (or) false { /ARGUMENTS where { /ARGUMENTS get dup type /arraytype eq { aload pop /ARGUMENTS //null store //true } @@ -791,44 +876,7 @@ userdict /.currentresourcefile //null put ifelse } { //false } ifelse } bind def -/.confirm { - DISPLAYING NOPAUSE not TTYPAUSE or and { - % Print a message (unless NOPAGEPROMPT or NOPROMPT is true) - % and wait for the user to type something. - % If the user just types a newline, flush it. - NOPAGEPROMPT NOPROMPT or { pop } { print flush } ifelse - .confirmread - } { - pop - } ifelse -} bind def -/.confirmread { - TTYPAUSE { - (/dev/tty) (r) file dup read pop pop closefile - } { - .echo.mode //false echo - (%stdin) (r) file dup read { - dup (\n) 0 get eq { pop pop } { unread } ifelse - } { - pop - } ifelse echo - } ifelse -} bind def -% Define the procedure used by .runfile, .runstdin and .runstring -% for executing user input. -% This is called with a procedure or executable file on the operand stack. -/.execute { % .execute - stopped $error /newerror get and - { /handleerror .systemvar exec flush //true } { //false } ifelse -} bind def -/execute { % execute - - .execute pop -} odef -% Define an execute analogue of runlibfile0. -/execute0 { % execute0 - - .execute { /execute0 cvx 1 .quit } if -} bind def % Define the procedure that the C code uses for running files % named on the command line. /.runfile { @@ -884,7 +932,8 @@ def } bind def % Temporarily substitute it for the real runlibfile. /.runlibfile /runlibfile load def -/runlibfile /runlibfile0 load def +/runlibfile //runlibfile0 def +currentdict /runlibfile0 .undef % Create the error handling machinery. % Define the standard error handlers. @@ -916,7 +965,7 @@ def 1 .instopped { //null eq { pop pop stop } if } if (I) //false .setdebug $error /.inerror get 1 .instopped { pop } { pop //true } ifelse - { .unstoppederrorhandler + { //.unstoppederrorhandler exec } if % detect error recursion $error /globalmode .currentglobal //false .setglobal put $error /.inerror //true put @@ -940,12 +989,12 @@ def } ifelse $error /position currentfile status - { currentfile { fileposition } .internalstopped { pop //null } if + { currentfile { fileposition } //.internalstopped exec { pop //null } if } { % If this was a scanner error, the file is no longer current, % but the command holds the file, which may still be open. $error /command get dup type /filetype eq - { { fileposition } .internalstopped { pop //null } if } + { { fileposition } //.internalstopped exec { pop //null } if } { pop //null } ifelse } @@ -956,59 +1005,14 @@ def $error /.inerror //false put stop } bind executeonly def +currentdict /.unstoppederrorhandler .undef + % Define the standard handleerror. We break out the printing procedure % (.printerror) so that it can be extended for binary output % if the Level 2 facilities are present. - /.printerror - { $error begin newerror - { - /command load errorname SHORTERRORS - { (%%[ Error: ) print =only flush - (; OffendingCommand: ) print =only - errorinfo dup //null eq { - pop - } { - (;\nErrorInfo:) print - dup type /arraytype eq - { { ( ) print =only } forall } - { ( ) print =only } - ifelse - } ifelse - ( ]%%) = flush - } - { (Error: ) print ==only flush - ( in ) print ==only flush - errorinfo dup //null eq { - pop - } { - (\nAdditional information: ) print ==only flush - } ifelse - .printerror_long - } - ifelse - .clearerror flush - } - { % newerror is //false, test to see if user has set handleerror to a different - % routine, if so execute it, otherwise, just return. This code deals with the - % Genoa issue of setting /handleerror, and then calling it, without an error - % being set. We were erroring in this case, due to /command load failing. - - //JOBSERVER { - /errordict .systemvar /handleerror get /.GShandleerror .systemvar ne - } { - //false - } ifelse - { /errordict .systemvar begin /handleerror load .internalstopped pop end - } - if - } - ifelse % newerror - end - flush - } bind executeonly def - /.printerror_long % long error printout, +/.printerror_long % long error printout, % $error is on the dict stack - { % Push the (anonymous) stack printing procedure. +{ % Push the (anonymous) stack printing procedure. % <==flag> proc { currentdict exch .knownget % stackname defined in $error? @@ -1082,18 +1086,59 @@ def { (Current file position is ) print position = } if - } bind executeonly def -% Define a procedure for clearing the error indication. -/.clearerror - { $error /newerror //false put - $error /errorname //null put - $error /errorinfo //null put - 0 .setoserrno - } bind executeonly def +} bind executeonly def +/.printerror +{ $error begin newerror + { + /command load errorname SHORTERRORS + { (%%[ Error: ) print =only flush + (; OffendingCommand: ) print =only + errorinfo dup //null eq { + pop + } { + (;\nErrorInfo:) print + dup type /arraytype eq + { { ( ) print =only } forall } + { ( ) print =only } + ifelse + } ifelse + ( ]%%) = flush + } + { (Error: ) print ==only flush + ( in ) print ==only flush + errorinfo dup //null eq { + pop + } { + (\nAdditional information: ) print ==only flush + } ifelse + //.printerror_long exec + } + ifelse + //.clearerror exec flush + } + { % newerror is //false, test to see if user has set handleerror to a different + % routine, if so execute it, otherwise, just return. This code deals with the + % Genoa issue of setting /handleerror, and then calling it, without an error + % being set. We were erroring in this case, due to /command load failing. + + //JOBSERVER { + /errordict .systemvar /handleerror get /.GShandleerror .systemvar ne + } { + //false + } ifelse + { /errordict .systemvar begin /handleerror load //.internalstopped exec pop end + } + if + } + ifelse % newerror + end + flush +} bind executeonly def +currentdict /.printerror_long .undef % Define $error. This must be in local VM. .currentglobal //false .setglobal -/$error 40 dict .forcedef % $error is local, systemdict is global +currentdict /$error 40 dict .forceput % $error is local, systemdict is global % newerror, errorname, command, errorinfo, % ostack, estack, dstack, recordstacks, % binary, globalmode, @@ -1112,8 +1157,8 @@ end % Define errordict similarly. It has one entry per error name, % plus handleerror. However, some astonishingly badly written PostScript % files require it to have at least one empty slot. -/errordict ErrorNames length 3 add dict -.forcedef % errordict is local, systemdict is global +currentdict /errordict ErrorNames length 3 add dict +.forceput % errordict is local, systemdict is global .setglobal % back to global VM % gserrordict contains all the default error handling methods, but unlike % errordict it is noaccess after creation (also it is in global VM). @@ -1129,22 +1174,24 @@ end % files. However, ErrorNames contains all of the error names regardless of % what features are included, so we have to "know" that VMerror is the last % Level 1 error. -/.registererror % .registererror - - { errordict exch .registererror2 - } bind def /.registererror2 % .registererror - { .currentglobal //true .setglobal % create procs in global VM 3 1 roll - mark 1 index systemdict /.errorhandler get /exec load .packtomark cvx put + mark 1 index systemdict /.errorhandler get /exec load //.packtomark exec cvx put .setglobal } bind def +/.registererror % .registererror - + { errordict exch //.registererror2 exec + } bind def +currentdict /.registererror2 .undef + ErrorNames { .registererror} forall errordict begin % The handlers for interrupt and timeout are special; there is no % 'current object', so they push their own name. { /interrupt /timeout } - { mark 1 index dup systemdict /.errorhandler get /exec load .packtomark cvx def + { mark 1 index dup systemdict /.errorhandler get /exec load //.packtomark exec cvx def } forall /handleerror % this key is 'well known' and some PS may redefine it { /.printerror .systemvar exec @@ -1168,8 +1215,8 @@ errordict /unknownerror .undef }ifelse }forall noaccess pop - systemdict /.setsafeerrors .forceundef - systemdict /.SAFERERRORLIST .forceundef + //systemdict /.setsafeerrors .forceundef + //systemdict /.SAFERERRORLIST .forceundef } bind executeonly odef SAFERERRORS {.setsafererrors} if @@ -1242,39 +1289,53 @@ end /=== { ===only (\n) print } bind def % Create the initialization queue. - -/.delayed_init_queue 10 dict def +1183615869 internaldict dup +/.delayed_init_queue 10 dict put /.schedule_init % .schedule_init - { - //.delayed_init_queue 2 index known { + 1183615869 internaldict begin + .delayed_init_queue 2 index known { + end (.delayed_init_queue priority conflict with ) print 1 index = /.schedule_init cvx /configurationerror signalerror } if - //.delayed_init_queue 3 1 roll .growput + .delayed_init_queue 3 1 roll .growput + end } bind def +begin /.execute_scheduled_inits % - .execute_scheduled_inits - { - { 0 //null //.delayed_init_queue { % maxp {} p {} + 2 dict begin + /.newdelayed_init_queue + mark + 1183615869 internaldict /.delayed_init_queue get {} forall + .dicttomark def + { + 0 //null .newdelayed_init_queue { % maxp {} p {} 3 index 2 index lt { 4 2 roll } if pop pop } forall - exch //.delayed_init_queue exch undef + exch .newdelayed_init_queue exch undef dup //null eq { pop exit } if exec } loop + currentdict /.newdelayed_init_queue undef + end } bind def +end (END PROCS) VMDEBUG % Define the font directory. +currentdict /FontDirectory //false .setglobal 100 dict //true .setglobal -.forcedef % FontDirectory is local, systemdict is global +.forceput % FontDirectory is local, systemdict is global % Define the encoding dictionary. /EncodingDirectory 16 dict def % enough for Level 2 + PDF standard encodings @@ -1336,7 +1397,7 @@ currentdict /PDFA known { PDFA type /booleantype eq { /PDFA 1 def } if } if % Loop until the .getdevice gets a rangecheck. errordict /rangecheck 2 copy get errordict /rangecheck { pop stop } put % pop the command - 0 { {dup .getdevice exch 1 add} loop} .internalstopped pop + 0 { {dup .getdevice exch 1 add} loop} //.internalstopped exec pop 1 add dict /devicedict 1 index def begin % 2nd copy of count is on stack { dup .devicename exch @@ -1542,12 +1603,20 @@ setpacking % Increase fill adjustment so that we effectively use Adobe's % any-part-of-pixel rule. - 0.5 .setfilladjust + 0.5 dup .setfilladjust2 } bind def + % Set the default screen and BG/UCR. +% We define the proc here, rather than inline in .setdefaultbgucr +% for the benefit of gs_cet.ps so jobs that do anything that causes +% .setdefaultbgucr to be called will still get the redefined proc +% in gs_cet.ps +(%.defaultbgrucrproc) cvn { pop 0 } def + /.setdefaultbgucr { systemdict /setblackgeneration known { - { pop 0 } dup setblackgeneration setundercolorremoval + (%.defaultbgrucrproc) cvn load dup + setblackgeneration setundercolorremoval } if } bind def /.useloresscreen { % - .useloresscreen @@ -1571,7 +1640,7 @@ setpacking % false /.getdefaulthalftone { % try the device to see if it has a default halftone - { currentdevice /HalftoneDefault //.gsgetdeviceprop exec } .internalstopped + { currentdevice /HalftoneDefault //.gsgetdeviceprop exec } //.internalstopped exec { pop pop //false } % no device property { dup type /dicttype eq { //true } { pop //false } ifelse } ifelse @@ -1579,7 +1648,7 @@ setpacking % false not found dup not { % device did not provide a default, try Resource - pop { /Default /Halftone /findresource .systemvar exec } .internalstopped + pop { /Default /Halftone /findresource .systemvar exec } //.internalstopped exec { pop pop //false } { //true } ifelse } if @@ -1587,18 +1656,20 @@ setpacking currentdict /.gsgetdeviceprop .forceundef /.setdefaulthalftone { - .getdefaulthalftone + //.getdefaulthalftone exec { sethalftone } { % default not found - .useloresscreen { .setloreshalftone } { .sethireshalftone pop } ifelse + //.useloresscreen exec { .setloreshalftone } { .sethireshalftone pop } ifelse } ifelse } bind def /.setdefaultscreen { - .useloresscreen { .setloresscreen } { .sethiresscreen } ifelse - .setdefaultbgucr + //.useloresscreen exec { .setloresscreen } { .sethiresscreen } ifelse + //.setdefaultbgucr exec } bind def +currentdict /.setdefaultbgucr .undef +currentdict /.useloresscreen .undef % Rendering intent mapping for setcolorrendering1 and PDF interpreter /.renderingintentdict mark @@ -1709,7 +1780,7 @@ currentdict /.gsgetdeviceprop .forceundef dup length 2 index length sub % drop "ffn", remaining "ldffn" = length of the "directory" part exch % {} b [dl] (templ) (ffn) ldffn (dffn) - .makepathtemplate % {} b [dl] (templ) (ffn) ldffn (Dffn) + //.makepathtemplate exec % {} b [dl] (templ) (ffn) ldffn (Dffn) dup % {} b [dl] (templ) (ffn) ldffn (Dffn) (Dffn) 4 index length dup % {} b [dl] (templ) (ffn) ldffn (Dffn) (Dffn) templL templL 2 index length % {} b [dl] (templ) (ffn) ldffn (Dffn) (Dffn) templL templL DffnL @@ -1741,7 +1812,8 @@ currentdict /.gsgetdeviceprop .forceundef } forall } ifelse % (t1) ?l1 (t2) ?l2 ... (tN) ?ln {} b [dl] (templ) (ffn) pop pop pop pop pop % (t1) ?l1 (t2) ?l2 ... (tN) ?ln -} bind def +} .bind executeonly odef +currentdict /.makepathtemplate .undef %