New upstream version 10.02.1~dfsg1
This commit is contained in:
parent
d56c7eb698
commit
f91a7dd0dd
|
@ -2,6 +2,8 @@
|
|||
[attr]tabs whitespace=trailing-space,space-before-tab,indent-with-non-tab,tabwidth=4
|
||||
[attr]spaces whitespace=trailing-space,space-before-tab,tabs-in-indent
|
||||
[attr]makefile whitespace=trailing-space,space-before-tab,indent-with-non-tab,tabwidth=8
|
||||
[attr]rst -whitespace
|
||||
[attr]svg -whitespace
|
||||
|
||||
* text=auto
|
||||
Make* makefile
|
||||
|
@ -13,7 +15,12 @@ Make* makefile
|
|||
*.txt spaces
|
||||
*.htm spaces
|
||||
*.css spaces
|
||||
*.pdf binary
|
||||
*.rst rst
|
||||
*.svg svg
|
||||
|
||||
# Source files
|
||||
*.c spaces
|
||||
*.h spaces
|
||||
|
||||
*.md text
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
# so VS2005 shows me a sensible 'Recent Projects' list. Ignore the copy.
|
||||
win32/GhostPDLGit.sln
|
||||
|
||||
windows/.vs
|
||||
|
||||
# Ignore all the object files
|
||||
bin
|
||||
debugbin
|
||||
|
@ -25,15 +27,21 @@ bin64
|
|||
debugbin64
|
||||
profbin64
|
||||
debugobj
|
||||
debugobjrt
|
||||
obj
|
||||
profobj
|
||||
memobj
|
||||
memobj64
|
||||
debugobj64
|
||||
obj64
|
||||
profobj64
|
||||
debugaux
|
||||
cscope.*
|
||||
autom4te.cache
|
||||
sobin
|
||||
sodebugbin
|
||||
soobj
|
||||
sodebugobj
|
||||
|
||||
gs/Makefile
|
||||
gs/Makefile.in
|
||||
|
@ -89,10 +97,13 @@ gs/jbig2dec/config.h
|
|||
gs/jbig2dec/configure.lineno
|
||||
gs/jbig2dec/libtool
|
||||
|
||||
config.guess
|
||||
config.log
|
||||
config.mak
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
install-sh
|
||||
tiff
|
||||
tiff-config
|
||||
|
||||
|
@ -100,6 +111,9 @@ tiff-config
|
|||
/Makefile
|
||||
/auxflags.mak
|
||||
|
||||
doc/.doctrees
|
||||
doc/.buildinfo
|
||||
|
||||
|
||||
# Adding the following lines would help limit the 'noise' seen in git status
|
||||
# due to files created during testing. Conversely, it prevents them being
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
path_classifiers:
|
||||
docs:
|
||||
- docs
|
||||
- examples
|
||||
|
||||
# Libraries that we maintain are explicitly given their own groups
|
||||
# They will be checked, and will contribute to our error/warning counts,
|
||||
# but we can easily enable/disable them in the web frontend.
|
||||
openjpeg:
|
||||
- openjpeg
|
||||
lcms2mt:
|
||||
- lcms2mt
|
||||
jbig2dec:
|
||||
- jbig2dec
|
||||
|
||||
# Other libraries that we take unchanged are listed here. These will
|
||||
# be scanned, but won't contribute to our counts.
|
||||
library:
|
||||
- expat
|
||||
- freetype
|
||||
- jpeg
|
||||
- jpegxr
|
||||
- libpng
|
||||
- tiff
|
||||
- zlib
|
||||
|
||||
devices:
|
||||
- devices
|
||||
contrib:
|
||||
- contrib
|
||||
tools:
|
||||
- toolbin
|
||||
- pcl/tools
|
|
@ -0,0 +1,29 @@
|
|||
# .readthedocs.yaml
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
# Set the version of Python and other tools you might need
|
||||
build:
|
||||
os: ubuntu-20.04
|
||||
tools:
|
||||
python: "3.9"
|
||||
# You can also specify other tool versions:
|
||||
# nodejs: "16"
|
||||
# rust: "1.55"
|
||||
# golang: "1.17"
|
||||
|
||||
# Build documentation in the docs/ directory with Sphinx
|
||||
sphinx:
|
||||
configuration: doc/src/conf.py
|
||||
|
||||
# If using Sphinx, optionally build your docs in additional formats such as PDF
|
||||
formats:
|
||||
- pdf
|
||||
|
||||
# Optionally declare the Python requirements required to build your docs
|
||||
python:
|
||||
install:
|
||||
- requirements: doc/src/requirements.txt
|
28
LICENSE
28
LICENSE
|
@ -39,31 +39,3 @@ License along with this program so you can know your rights and
|
|||
responsibilities. It should be in a file named doc/COPYING. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place Suite
|
||||
330, Boston, MA 02111-1307, USA.
|
||||
|
||||
---
|
||||
|
||||
GPL Ghostscript contains an implementation of techniques covered
|
||||
by US Patents 5,055,942 and 5,917,614, and corresponding
|
||||
international patents. These patents are licensed for use with
|
||||
GPL Ghostscript under the following grant:
|
||||
|
||||
Whereas, Raph Levien (hereinafter "Inventor") has obtained patent
|
||||
protection for related technology (hereinafter "Patented
|
||||
Technology"), Inventor wishes to aid the the GNU free software
|
||||
project in achieving its goals, and Inventor also wishes to
|
||||
increase public awareness of Patented Technology, Inventor hereby
|
||||
grants a fully paid up, nonexclusive, royalty free license to
|
||||
practice the patents listed below ("the Patents") if and only if
|
||||
practiced in conjunction with software distributed under the
|
||||
terms of any version of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, 59 Temple Place, Suite
|
||||
330, Boston, MA 02111. Inventor reserves all other rights,
|
||||
including without limitation, licensing for software not
|
||||
distributed under the GNU Affero General Public License.
|
||||
|
||||
5055942 Photographic image reproduction device using digital
|
||||
halftoning to screen images allowing adjustable coarseness
|
||||
|
||||
5917614 Method and apparatus for error diffusion screening of
|
||||
images with improved smoothness in highlight and shadow
|
||||
regions
|
||||
|
|
142
Makefile.in
142
Makefile.in
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
# Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
# of the license contained in the file LICENSE in this distribution.
|
||||
#
|
||||
# Refer to licensing information at http://www.artifex.com or contact
|
||||
# Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
# CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
# Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
# CA 94129, USA, for further information.
|
||||
#
|
||||
# makefile template for/from the autoconf build.
|
||||
# @configure_input@
|
||||
|
@ -55,10 +55,22 @@ XPSSRCDIR=@srcdir@/xps
|
|||
XPSGENDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
|
||||
XPSOBJDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
|
||||
|
||||
PDFSRCDIR=@srcdir@/pdf
|
||||
PDFGENDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
|
||||
PDFOBJDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
|
||||
|
||||
GPDLSRCDIR=@srcdir@/gpdl
|
||||
GPDLGENDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
|
||||
GPDLOBJDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
|
||||
|
||||
URFSRCDIR=@srcdir@/urf
|
||||
URFGENDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
|
||||
URFOBJDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
|
||||
|
||||
SOSRCDIR=@srcdir@/so
|
||||
SOGENDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
|
||||
SOOBJDIR=./$(BUILDDIRPREFIX)@OBJDIR_BSDMAKE_WORKAROUND@
|
||||
|
||||
CONTRIBDIR=@srcdir@/contrib
|
||||
|
||||
# Do not edit the next group of lines.
|
||||
|
@ -113,6 +125,11 @@ COMPILE_INITS=@COMPILE_INITS@
|
|||
|
||||
GS_LIB_DEFAULT=$(gsdatadir)/Resource/Init:$(gsdatadir)/lib:$(gsdatadir)/Resource/Font:$(gsdir)/fonts:@fontpath@
|
||||
|
||||
# Define the default search path for Tesseract. Separate multiple directories
|
||||
# with a :.
|
||||
|
||||
TESSDATA=@tessdata@
|
||||
|
||||
# Define the default directory for cached data files
|
||||
# this must be a single path.
|
||||
|
||||
|
@ -172,24 +189,43 @@ CAPOPT= @HAVE_MKSTEMP@ @HAVE_FILE64@ @HAVE_FSEEKO@ @HAVE_MKSTEMP64@ @HAVE_FONTCO
|
|||
|
||||
GS=@GS@
|
||||
GS_SO_BASE=@GS@
|
||||
GS_SONAME=@GS_SONAME@
|
||||
GS_SONAME_MAJOR=@GS_SONAME_MAJOR@
|
||||
GS_SONAME_MAJOR_MINOR=@GS_SONAME_MAJOR_MINOR@
|
||||
|
||||
PCL=@PCL@
|
||||
PCL_SO_BASE=@PCL@
|
||||
PCL_SONAME=@PCL_SONAME@
|
||||
PCL_SONAME_MAJOR=@PCL_SONAME_MAJOR@
|
||||
PCL_SONAME_MAJOR_MINOR=@PCL_SONAME_MAJOR_MINOR@
|
||||
|
||||
XPS=@XPS@
|
||||
XPS_SO_BASE=@XPS@
|
||||
XPS_SONAME=@XPS_SONAME@
|
||||
XPS_SONAME_MAJOR=@XPS_SONAME_MAJOR@
|
||||
XPS_SONAME_MAJOR_MINOR=@XPS_SONAME_MAJOR_MINOR@
|
||||
|
||||
PDF=@PDF@
|
||||
PDF_SO_BASE=@PDF@
|
||||
PDF_SONAME=@PDF_SONAME@
|
||||
PDF_SONAME_MAJOR=@PDF_SONAME_MAJOR@
|
||||
PDF_SONAME_MAJOR_MINOR=@PDF_SONAME_MAJOR_MINOR@
|
||||
|
||||
GPDL=@GPDL@
|
||||
GPDL_SO_BASE=@GPDL@
|
||||
GPDL_SONAME=@GPDL_SONAME@
|
||||
GPDL_SONAME_MAJOR=@GPDL_SONAME_MAJOR@
|
||||
GPDL_SONAME_MAJOR_MINOR=@GPDL_SONAME_MAJOR_MINOR@
|
||||
|
||||
XE=@EXEEXT@
|
||||
XEAUX=@EXEEXT@
|
||||
XEAUX=@AUXEXEEXT@
|
||||
|
||||
PCL_TARGET=@PCL_TARGET@
|
||||
XPS_TARGET=@XPS_TARGET@
|
||||
PDF_TARGET=@PDF_TARGET@
|
||||
GPDL_TARGET=@GPDL_TARGET@
|
||||
|
||||
PCL_XPS_TARGETS=$(PCL_TARGET) $(XPS_TARGET) @GPDL_TARGET_VAR@
|
||||
PCL_XPS_PDL_TARGETS=$(PCL_TARGET) $(XPS_TARGET) $(GPDL_TARGET) $(PDF_TARGET)
|
||||
|
||||
# Define the directories for debugging and profiling binaries, relative to
|
||||
# the standard binaries.
|
||||
|
@ -207,6 +243,9 @@ CAL_SSE4_2_CFLAGS=@CAL_SSE4_2_CFLAGS@
|
|||
CAL_AVX2_CFLAGS=@CAL_AVX2_CFLAGS@
|
||||
CAL_NEON_CFLAGS=@CAL_NEON_CFLAGS@
|
||||
|
||||
# Location of extract library (can be empty).
|
||||
EXTRACT_DIR=@EXTRACT_DIR@
|
||||
|
||||
# Define whether to compile in the FreeType library, and if so, where
|
||||
# the source tree is location. Otherwise, what library name to use
|
||||
# in linking to a shared implementation.
|
||||
|
@ -214,9 +253,9 @@ CAL_NEON_CFLAGS=@CAL_NEON_CFLAGS@
|
|||
FT_BRIDGE=@FT_BRIDGE@
|
||||
SHARE_FT=@SHARE_FT@
|
||||
FTSRCDIR=@FTSRCDIR@
|
||||
FT_CFLAGS=@FT_CFLAGS@ -DSHARE_FT=@SHARE_FT@
|
||||
FT_CFLAGS=@FT_CFLAGS@ @FT_HIDDEN_CFLAGS@ -DSHARE_FT=@SHARE_FT@
|
||||
FT_LIBS=@FT_LIBS@
|
||||
FT_CONFIG_SYSTEM_ZLIB=@FT_SYS_ZLIB@
|
||||
FT_LIB_PATH=@FT_LIB_PATH@
|
||||
|
||||
# Define whether to compile in UFST.
|
||||
# FAPI/UFST depends on UFST_BRIDGE being undefined - hence the construct below.
|
||||
|
@ -270,6 +309,7 @@ TIFFPLATFORM=unix
|
|||
TIFFCONFIG_SUFFIX=
|
||||
LIBTIFF_NAME=tiff
|
||||
TIFF_CFLAGS=@TIFFCFLAGS@
|
||||
ENABLE_TIFF=@ENABLETIFF@
|
||||
|
||||
# Define the directory where the zlib sources are stored.
|
||||
# See zlib.mak for more information.
|
||||
|
@ -287,15 +327,6 @@ SHARE_JBIG2=@SHARE_JBIG2@
|
|||
JBIG2SRCDIR=@JBIG2DIR@
|
||||
JBIG2_CFLAGS=@JBIG2_AUTOCONF_CFLAGS@
|
||||
|
||||
# uncomment the following three lines and one of the last two to
|
||||
# compile in the Luratech ldf_jb2 codec
|
||||
#JBIG2_LIB=luratech
|
||||
#SHARE_JBIG2=0
|
||||
#JBIG2SRCDIR=ldf_jb2
|
||||
#JBIG2_CFLAGS=-DUSE_LDF_JB2 -DLINUX
|
||||
#JBIG2_CFLAGS=-DUSE_LDF_JB2 -DMAC -DMAC_OS_X_BUILD
|
||||
|
||||
|
||||
# Choose the library to use for (JPXDecode support)
|
||||
# whether to link to an external build or compile in from source
|
||||
# and source location and configuration flags for compiling in
|
||||
|
@ -304,20 +335,6 @@ SHARE_JPX=@SHARE_JPX@
|
|||
JPXSRCDIR=@JPXDIR@
|
||||
JPX_CFLAGS=-DSHARE_JPX=$(SHARE_JPX) @JPX_AUTOCONF_CFLAGS@ @JPX_SSE_CFLAGS@
|
||||
|
||||
# uncomment the following three lines and one of the last two to
|
||||
# compile in the Luratech lwf_jp2 codec
|
||||
#JPX_LIB=luratech
|
||||
#SHARE_JPX=0
|
||||
#JPXSRCDIR=lwf_jp2
|
||||
#JPX_CFLAGS=-DUSE_LWF_JP2 -DLINUX
|
||||
#JPX_CFLAGS=-DUSE_LWF_JP2 -DMAC -DMAC_OS_X_BUILD
|
||||
|
||||
# Uncomment the following 4 lines to to compile in OpenJPEG codec
|
||||
#JPX_LIB=openjpeg
|
||||
#SHARE_JPX=0
|
||||
#JPXSRCDIR=openjpeg
|
||||
#JPX_CFLAGS=-DUSE_OPENJPEG_JP2 -DOPJ_STATIC
|
||||
|
||||
# options for lcms color management library
|
||||
SHARE_LCMS=@SHARELCMS@
|
||||
LCMS2SRCDIR=@LCMS2DIR@
|
||||
|
@ -328,9 +345,20 @@ LCMS2_CFLAGS=-DSHARE_LCMS=$(SHARE_LCMS) @LCMS2_ENDIAN@ @SQRTF_SUBST@ @LCMS2_PTR
|
|||
# Options are currently lcms or lcms2
|
||||
WHICH_CMS=@WHICHLCMS@
|
||||
|
||||
# Do we have URF support?
|
||||
ENABLE_URF=@ENABLEURF@
|
||||
GPDL_URF_TOP_OBJ=@GPDL_URF_TOP_OBJ@
|
||||
URF_INCLUDE=@URF_INCLUDE@
|
||||
URF_DEV=@URF_DEV@
|
||||
SURFX_H=@SURFX_H@
|
||||
|
||||
# Do we have SmartOffice support?
|
||||
ENABLE_SO=@ENABLESO@
|
||||
GPDL_SO_TOP_OBJ=@GPDL_SO_TOP_OBJ@
|
||||
SO_PDFEXPORT_LIB=@SO_PDFEXPORT_LIB@
|
||||
|
||||
EXPATSRCDIR=@EXPATDIR@
|
||||
EXPAT_CFLAGS=@EXPAT_CFLAGS@
|
||||
EXPAT_CFLAGS=@EXPAT_CFLAGS@ @XML_HIDDEN_CFLAGS@
|
||||
EXPATGENDIR=$(GLGENDIR)
|
||||
EXPATOBJDIR=$(GLOBJDIR)
|
||||
EXPATINCDIR = $(EXPATSRCDIR)$(D)lib
|
||||
|
@ -361,6 +389,7 @@ CUPSPDFTORASTER=@CUPSPDFTORASTER@
|
|||
SHARE_LCUPS=@SHARELCUPS@
|
||||
LCUPS_NAME=cups
|
||||
LCUPSSRCDIR=@CUPS_DIR@
|
||||
LIBCUPSSRCDIR=@LIB_CUPS_DIR@
|
||||
LCUPSBUILDTYPE=@LCUPSBUILDTYPE@
|
||||
CUPS_CC=$(CC)
|
||||
|
||||
|
@ -395,7 +424,7 @@ CCAUXLD=$(CCAUX)
|
|||
|
||||
# Define the default gcc flags.
|
||||
GCFLAGS=@CPPFLAGS@ @GCFLAGS@ @CFLAGS@ @HAVE_POPEN_PROTO@
|
||||
GCFLAGSAUX=@GCFLAGSAUX@ @HAVE_POPEN_PROTO@
|
||||
GCFLAGSAUX=@GCFLAGSAUX@ @CFLAGSAUX@ @HAVE_POPEN_PROTO@
|
||||
|
||||
# Define the added flags for standard, debugging, profiling
|
||||
# and shared object builds.
|
||||
|
@ -439,6 +468,8 @@ DBUS_LIBS=@DBUS_LIBS@
|
|||
# defines from autoconf; note that we don't use all of these at present.
|
||||
ACDEFS=@DEFS@
|
||||
|
||||
CFLAGS_VISIBILITY=@CFLAGS_VISIBILITY@
|
||||
|
||||
CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(AC_CFLAGS) $(XCFLAGS) @CLUSTER_CFLAGS@
|
||||
CFLAGSAUX=$(CFLAGSAUX_STANDARD) $(GCFLAGSAUX) $(XCFLAGSAUX)
|
||||
|
||||
|
@ -460,11 +491,13 @@ GS_LDFLAGS=$(LDFLAGS)
|
|||
PCL_LDFLAGS=$(LDFLAGS)
|
||||
XPS_LDFLAGS=$(LDFLAGS)
|
||||
PDL_LDFLAGS=$(LDFLAGS)
|
||||
PDF_LDFLAGS=$(LDFLAGS)
|
||||
|
||||
GS_LDFLAGS_SO=@GS_DYNAMIC_LDFLAGS@
|
||||
PCL_LDFLAGS_SO=@PCL_DYNAMIC_LDFLAGS@
|
||||
XPS_LDFLAGS_SO=@XPS_DYNAMIC_LDFLAGS@
|
||||
PDL_LDFLAGS_SO=@PDL_DYNAMIC_LDFLAGS@
|
||||
PDF_LDFLAGS_SO=@PDF_DYNAMIC_LDFLAGS@
|
||||
|
||||
# Define any extra libraries to link into the executable.
|
||||
# ISC Unix 2.2 wants -linet.
|
||||
|
@ -483,7 +516,7 @@ AUXEXTRALIBS=@AUXEXTRALIBS@ @AUX_SHARED_ZLIB@
|
|||
# All reasonable platforms require -lm, but Rhapsody and perhaps one or
|
||||
# two others fold libm into libc and don't require any additional library.
|
||||
|
||||
STDLIBS=@PTHREAD_LIBS@ -lm
|
||||
STDLIBS=@PTHREAD_LIBS@ -lm @TESSERACT_LIBS@
|
||||
|
||||
# Define the include switch(es) for the X11 header files.
|
||||
# This can be null if handled in some other way (e.g., the files are
|
||||
|
@ -538,12 +571,15 @@ SO_LIB_VERSION_SEPARATOR=@SO_LIB_VERSION_SEPARATOR@
|
|||
#CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
#CAIRO_LIBS = @CAIRO_LIBS@
|
||||
|
||||
# AUX Tools flags
|
||||
MKROMFS_FLAGS=@MKROMFS_FLAGS@
|
||||
|
||||
# ------ Devices and features ------ #
|
||||
|
||||
# Choose the language feature(s) to include. See gs.mak for details.
|
||||
|
||||
# if it's included, $(PSD)gs_pdfwr.dev should always be one of the last in the list
|
||||
PSI_FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)epsf.dev $(PSD)ttfont.dev \
|
||||
PSI_FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev @GPDF_DEV@ $(PSD)epsf.dev $(PSD)ttfont.dev \
|
||||
@UTF8DEVS@ $(PSD)fapi_ps.dev $(PSD)jpx.dev $(PSD)jbig2.dev $(PSD)gs_pdfwr.dev
|
||||
|
||||
|
||||
|
@ -552,13 +588,15 @@ PCL_FEATURE_DEVS=$(PLOBJDIR)/pl.dev $(PLOBJDIR)/pjl.dev $(PXLOBJDIR)/pxl.dev $(P
|
|||
|
||||
XPS_FEATURE_DEVS=$(XPSOBJDIR)/pl.dev $(XPSOBJDIR)/xps.dev
|
||||
|
||||
PDF_FEATURE_DEVS=$(PDFOBJDIR)/pl.dev $(PDFOBJDIR)/gpdf.dev
|
||||
|
||||
FEATURE_DEVS=$(GLD)pipe.dev $(GLD)gsnogc.dev $(GLD)htxlib.dev $(GLD)psl3lib.dev $(GLD)psl2lib.dev \
|
||||
$(GLD)dps2lib.dev $(GLD)path1lib.dev $(GLD)patlib.dev $(GLD)psl2cs.dev $(GLD)rld.dev $(GLD)gxfapiu$(UFST_BRIDGE).dev\
|
||||
$(GLD)ttflib.dev $(GLD)cielib.dev $(GLD)pipe.dev $(GLD)htxlib.dev $(GLD)sdct.dev $(GLD)libpng.dev\
|
||||
$(GLD)seprlib.dev $(GLD)translib.dev $(GLD)cidlib.dev $(GLD)psf0lib.dev $(GLD)psf1lib.dev\
|
||||
$(GLD)psf2lib.dev $(GLD)lzwd.dev $(GLD)sicclib.dev \
|
||||
$(GLD)sjbig2.dev $(GLD)sjpx.dev $(GLD)ramfs.dev \
|
||||
$(GLD)pwgd.dev $(GLD)siscale.dev
|
||||
$(GLD)pwgd.dev $(GLD)siscale.dev $(URF_DEV)
|
||||
|
||||
#FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev
|
||||
#FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)ttfont.dev $(GLD)pipe.dev
|
||||
|
@ -622,7 +660,7 @@ DISPLAY_DEV=$(DD)bbox.dev
|
|||
#DEVICE_DEVS18=
|
||||
#DEVICE_DEVS19=
|
||||
#DEVICE_DEVS20=$(DD)cljet5.dev $(DD)cljet5c.dev
|
||||
#DEVICE_DEVS21=$(DD)spotcmyk.dev $(DD)devicen.dev $(DD)xcf.dev $(DD)psdcmyk.dev $(DD)psdrgb.dev $(DD)psdcmykog.dev $(DD)fpng.dev
|
||||
#DEVICE_DEVS21=$(DD)spotcmyk.dev $(DD)devicen.dev $(DD)xcf.dev $(DD)psdcmyk.dev $(DD)psdrgb.dev $(DD)psdrgbtags.dev $(DD)psdcmykog.dev $(DD)fpng.dev
|
||||
DEVICE_DEVS=$(DISPLAY_DEV) @X11_DEVS@
|
||||
DEVICE_DEVS1=@F_DEVS@
|
||||
DEVICE_DEVS2=@P_DEVS@
|
||||
|
@ -639,7 +677,7 @@ DEVICE_DEVS12=
|
|||
DEVICE_DEVS13=
|
||||
DEVICE_DEVS14=
|
||||
DEVICE_DEVS15=
|
||||
DEVICE_DEVS16=
|
||||
DEVICE_DEVS16=@OCR_DEVS@
|
||||
DEVICE_DEVS17=
|
||||
DEVICE_DEVS18=
|
||||
DEVICE_DEVS19=
|
||||
|
@ -692,6 +730,19 @@ LD_SET_DT_SONAME=@SET_DT_SONAME@
|
|||
MAKEDIRS=@ORDER_ONLY@ directories
|
||||
MAKEDIRSTOP=
|
||||
|
||||
OCR_VERSION=@OCR_VERSION@
|
||||
OCR_SHARED=@OCR_SHARED@
|
||||
LEPTONICADIR=@LEPTONICADIR@
|
||||
TESSAVX=@TESS_AVX@
|
||||
TESSAVX2=@TESS_AVX2@
|
||||
TESSFMA=@TESS_FMA@
|
||||
TESSSSE41=@TESS_SSE4_1@
|
||||
TESSNEON=@TESS_NEON@
|
||||
TESSCXXFLAGS=@TESS_CXXFLAGS@
|
||||
TESSERACTDIR=@TESSERACTDIR@
|
||||
# Since C++ is only used for tesseract, set the compiler here
|
||||
CXX=@CXX@
|
||||
|
||||
# ---------------- End of platform-specific section ---------------- #
|
||||
|
||||
INSTALL_CONTRIB=@INSTALL_CONTRIB@
|
||||
|
@ -700,6 +751,7 @@ include $(GLSRCDIR)/gs.mak
|
|||
# *romfs.mak must precede lib.mak
|
||||
include @PLROMFS_MAK@ # plromfs.mak
|
||||
include @XPSROMFS_MAK@ # xpsromfs.mak
|
||||
include @PDFROMFS_MAK@ # pdfromfs.mak
|
||||
|
||||
include $(PSSRCDIR)/psromfs.mak
|
||||
include $(GLSRCDIR)/lib.mak
|
||||
|
@ -712,30 +764,36 @@ include @PXL_MAK@ # pxl.mak
|
|||
|
||||
include @XPS_MAK@ # xps.mak
|
||||
|
||||
include $(GLSRCDIR)/jpeg.mak
|
||||
|
||||
include @PDF_MAK@ # pdf.mak
|
||||
|
||||
include @GPDL_MAK@ # gpdl.mak
|
||||
|
||||
include $(GLSRCDIR)/freetype.mak
|
||||
include @FAPIUFST_MAK@
|
||||
include $(GLSRCDIR)/jpeg.mak
|
||||
# zlib.mak must precede png.mak
|
||||
include $(GLSRCDIR)/zlib.mak
|
||||
include $(GLSRCDIR)/png.mak
|
||||
include $(GLSRCDIR)/tiff.mak
|
||||
include $(GLSRCDIR)/jbig2.mak
|
||||
include $(GLSRCDIR)/ldf_jb2.mak
|
||||
include $(GLSRCDIR)/lwf_jp2.mak
|
||||
include $(GLSRCDIR)/openjpeg.mak
|
||||
include $(GLSRCDIR)/cal.mak
|
||||
@LEPTONICAINCLUDE@
|
||||
@TESSERACTINCLUDE@
|
||||
include $(GLSRCDIR)/ocr.mak
|
||||
|
||||
include $(GLSRCDIR)/jpegxr.mak
|
||||
include $(GLSRCDIR)/expat.mak
|
||||
|
||||
include $(DEVSRCDIR)/extract.mak
|
||||
|
||||
include $(GLSRCDIR)/$(WHICH_CMS).mak
|
||||
include $(GLSRCDIR)/ijs.mak
|
||||
@LCUPSINCLUDE@
|
||||
@LCUPSIINCLUDE@
|
||||
include $(DEVSRCDIR)/devs.mak
|
||||
include $(DEVSRCDIR)/contrib.mak
|
||||
include $(DEVSRCDIR)/dcontrib.mak
|
||||
include $(GLSRCDIR)/unix-aux.mak
|
||||
include $(GLSRCDIR)/unixlink.mak
|
||||
include $(GLSRCDIR)/unix-dll.mak
|
||||
|
@ -748,7 +806,7 @@ include $(GLSRCDIR)/unixinst.mak
|
|||
distclean : clean config-clean soclean pgclean debugclean mementoclean
|
||||
-$(RM_) -r $(BINDIR) $(GLOBJDIR) $(PSOBJDIR) $(AUXDIR)
|
||||
-$(RM_) -r autom4te.cache
|
||||
-$(RM_) config.log config.status
|
||||
-$(RM_) config.log config.status configaux.log @ARCH_AUTOCONF_HEADER@
|
||||
-$(RM_) -r $(TIFFCONFDIR)
|
||||
-$(RM_) Makefile
|
||||
|
||||
|
|
Binary file not shown.
|
@ -1,4 +1,5 @@
|
|||
% Copyright (C) 2003-2018 Artifex Software. All rights reserved.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
% implied.
|
||||
|
@ -7,11 +8,9 @@
|
|||
% modified or distributed except as expressly authorized under the terms
|
||||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% For more information about licensing, please refer to
|
||||
% http://www.ghostscript.com/licensing/. For information on
|
||||
% commercial licensing, go to http://www.artifex.com/licensing/ or
|
||||
% contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
|
||||
% Novato, CA 94945, U.S.A., +1(415)492-9861.
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
% Identity-UTF16-H CMap
|
||||
% An identity mapping of UTF16 codes to CIDs.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% DefaultCMYK color space resource.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% DefaultGray color space resource.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% DefaultRGB color space resource.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Color space that simulates appearance of the standard CMYK to RGB conversion.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% One-component color space similar to sRGB color space.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% sRGB color space derived from the public domain HP sample.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
%
|
||||
% FCO_Symbol Decoding
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
%
|
||||
% FCO_Symbol Decoding
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
%
|
||||
% Unicode Decoding
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
%
|
||||
% FCO_Wingdings Decoding
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Decoding for mapping PS names to codes for renderers which cannot
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Decoding for StandardEncoding
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
%
|
||||
% Unicode Decoding
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
/CEEncoding [
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
/ExpertEncoding [
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
/ExpertSubsetEncoding [
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the Notdef encoding vector.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the Wingdings encoding vector.
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,24 @@
|
|||
%%
|
||||
%% Idioms for the PPI Media GmbH PPI_ColorUtils ProcSet
|
||||
%% This appears to be a kind of desktop colour separation utility. If it is
|
||||
%% used with the pdfwrite PassThroughJPEGImages feature then instead of
|
||||
%% converting images from colour to gray, we embed the colour image data
|
||||
%% but with a DeviceGray colour space, which leads to incorrect output.
|
||||
%% To fix that, turn off the feature if cuForceGray is set to true. This
|
||||
%% is the first time we've seen this, and more work may be required.
|
||||
%%
|
||||
|
||||
currentuserparams /IdiomRecognition get
|
||||
<</IdiomRecognition false>> setuserparams
|
||||
|
||||
/PPI_CUtils
|
||||
<<
|
||||
/cuForceGray [
|
||||
{/_cuForceGray exch cuPut} bind
|
||||
{dup //true eq {currentdevice //null //false mark /PassThroughJPEGImages //false .putdeviceparamsonly}if pop pop /_cuForceGray exch cuPut} bind
|
||||
]
|
||||
>>
|
||||
|
||||
/IdiomSet defineresource pop
|
||||
|
||||
<</IdiomRecognition 3 -1 roll>> setuserparams
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Fontmap - standard font catalog for Ghostscript.
|
||||
|
@ -82,7 +82,11 @@
|
|||
% as well as with PostScript interpreters; .gsf fonts are compatible with
|
||||
% PostScript interpreters, but not with ATM or similar programs.
|
||||
|
||||
%
|
||||
% NOTE: (as of 9.56.0) The use of Postscript operators in the cidfmap file is now deprecated, for
|
||||
% compatibility with (and security of) the PDF interpreter implemented in C (rather than Postscript).
|
||||
% Thus operations such as "getenv", "cvn" and ".concatstrings" are no longer supported.
|
||||
|
||||
%
|
||||
%
|
||||
% Fonts contributed by:
|
||||
% URW++ Design and Development Incorporated
|
||||
|
|
|
@ -36,10 +36,11 @@
|
|||
%
|
||||
% /ShinGo-Bold /HeiseiKakuGo-W5 ;
|
||||
% /Ryumin-Medium << /FileType /TrueType /Path (H:/AuxFiles/Fonts/BATANG.TTC) /SubfontID 3 /CSI [(Japan1) 2] >> ;
|
||||
% /Ryumin-Medium << /FileType /TrueType /Path (windir) getenv not {(c:/windows)}if (/Fonts/BATANG.TTC)concatstrings /SubfontID 3 /CSI [(Japan1) 2] >> ;
|
||||
% /Ryumin-Medium << /FileType /TrueType /Path (c:/windows/Fonts/BATANG.TTC) /SubfontID 3 /CSI [(Japan1) 2] >> ;
|
||||
%
|
||||
% NOTE: getenv returns a boolean to indicate success of or failure, as well as the value on success. In the example, it uses this
|
||||
% to include a default value should getenv fail.
|
||||
% NOTE: (as of 9.56.0) The use of Postscript operators in the cidfmap file is now deprecated, for compatibility
|
||||
% with (and security of) the PDF interpreter implemented in C (rather than Postscript). Thus operations such
|
||||
% as "getenv", "cvn" and ".concatstrings" are no longer supported.
|
||||
%
|
||||
% (Century Gothic) << /FileType /TrueType /Path (/usr/share/fonts/truetype/fonts-japanese-gothic.ttf) /CSI [(Identity) 1] >> ;
|
||||
%
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% $Id: gs_agl.ps 10822 2010-02-27 20:24:13Z alexcher $
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Initialization file for binary tokens.
|
||||
|
@ -148,46 +148,36 @@ mark
|
|||
% worry about interrupts or callbacks when writing to the output file.
|
||||
|
||||
% Define procedures for accumulating the space required to represent
|
||||
% an object in binary form. The procedures for composite objects (arrays
|
||||
% and dictionaries) leave different results on the stack:
|
||||
% <#refs> <#chars> <simple_obj> -proc- <#refs> <#chars>
|
||||
% <#refs> <#chars> <array|dict> -proc- <array|dict> <#refs> <#chars>
|
||||
% This is required so that .writeobjects can also accumulate the actual
|
||||
% list of composite objects to write in the binary object sequence.
|
||||
% an object in binary form.
|
||||
% <#refs> <#chars> <obj> -proc- <#refs'> <#chars'>
|
||||
/cntdict mark
|
||||
/integertype /pop load
|
||||
/realtype 1 index
|
||||
/marktype 1 index
|
||||
/nulltype 1 index
|
||||
/booleantype 1 index
|
||||
/nametype { length add } bind
|
||||
/nametype { length add } .bind
|
||||
/stringtype 1 index
|
||||
/arraytype //null
|
||||
/dicttype //null
|
||||
/arraytype 0 % replaced below
|
||||
/dicttype 0 % replaced below
|
||||
.dicttomark def
|
||||
/.cntobj { % <<arguments and results as for procedures in cntdict>>
|
||||
/.cntobj {
|
||||
dup type //cntdict exch get exec
|
||||
} .bind def
|
||||
cntdict /arraytype {
|
||||
dup dup length 5 -1 roll add 4 2 roll { //.cntobj exec } forall
|
||||
} bind put
|
||||
dup length % #refs #chars array len
|
||||
4 -1 roll add % #chars array #refs+len
|
||||
dup 65536 gt {
|
||||
/writeobject .systemvar /limitcheck signalerror
|
||||
} if
|
||||
3 1 roll % #refs+len #chars array
|
||||
//.cntobj forall
|
||||
} .bind put % replace arraytype in cntdict
|
||||
|
||||
cntdict /dicttype {
|
||||
WRITEDICTS {
|
||||
dup dup length 2 mul 5 -1 roll add 4 2 roll {
|
||||
% 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 exec} exch 2 .execn //.cntobj exec
|
||||
} forall
|
||||
} {
|
||||
/writeobject .systemvar /typecheck signalerror
|
||||
} ifelse
|
||||
/writeobject .systemvar /typecheck signalerror
|
||||
} bind put
|
||||
|
||||
/w2dict mark
|
||||
/nametype { 2 copy .writecvs pop } bind
|
||||
/stringtype 1 index
|
||||
.dicttomark def
|
||||
|
||||
/.bosheader { % <top_length> <total_length> <string8> .bosheader
|
||||
% <string4|8>
|
||||
|
@ -211,70 +201,74 @@ cntdict /dicttype {
|
|||
} .bind def
|
||||
|
||||
/.writeobjects { % <file> <tag> <array> .writeobjects -
|
||||
mark exch
|
||||
% Apply the tag early and forget about it.
|
||||
(12345678) dup 1 5 -1 roll % file array (...) (...) 1 tag
|
||||
put exch % file (.t.) array
|
||||
|
||||
% Count the space required for refs and strings.
|
||||
% Calculate the space required for refs and strings.
|
||||
% Reject excessively large graphs or graphs with loops.
|
||||
0 0 % file (.t.) array #refs #chars
|
||||
2 index //.cntobj exec % file (.t.) array #refs #chars
|
||||
|
||||
dup length 0 3 -1 roll
|
||||
% Stack: file tag -mark- #refs #chars array
|
||||
dup 4 1 roll { //.cntobj exec } forall
|
||||
% Write the header.
|
||||
1 index 8 mul add % file (.t.) array #refs #refs*8+#chars
|
||||
2 index length exch (12345678) % file (.t.) array #refs len(array) #refs*8+#chars (...)
|
||||
//.bosheader exec % file (.t.) array #refs (...)
|
||||
4 index exch writestring % file (.t.) array #refs
|
||||
|
||||
% Write the header.
|
||||
|
||||
% Stack: file tag -mark- array1 ... (array|dict)N #refs #chars
|
||||
counttomark 3 add -2 roll 4 1 roll
|
||||
% 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 exec writestring
|
||||
|
||||
% Write the objects per se.
|
||||
|
||||
3 1 roll pop
|
||||
counttomark 1 sub index length 3 bitshift exch
|
||||
3 bitshift
|
||||
% Stack: -mark- array1 ... (array|dict)N tag file ref# char#
|
||||
counttomark 4 sub {
|
||||
counttomark -1 roll dup 6 1 roll
|
||||
% Stack: ... objN tag file ref# char# objN
|
||||
dup type /dicttype eq { % can't be first object
|
||||
{ 5 1 roll (x\000xxxxxx) .bosobject
|
||||
3 index exch writestring
|
||||
4 -1 roll (x\000xxxxxx) .bosobject
|
||||
3 index exch writestring
|
||||
% Traverse an array tree in width-first order and place all the
|
||||
% arrays that are found on the operand stack. Acyclic graphs are
|
||||
% expanded to trees. The top parameter K indicates the number
|
||||
% of arrays on a given depth level. At the root level, K is equal to 1.
|
||||
mark 2 index 1 % file (.t.) array #refs -mark- array K
|
||||
{ dup 0 le { pop exit } if
|
||||
dup {
|
||||
dup index {
|
||||
dup type /arraytype eq {
|
||||
exch 1 add
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
} forall
|
||||
} {
|
||||
{ (x\000xxxxxx) .bosobject
|
||||
dup 1 6 index put
|
||||
3 index exch writestring
|
||||
4 -1 roll pop 0 4 1 roll % clear tag
|
||||
} forall
|
||||
} ifelse
|
||||
} repeat
|
||||
1 sub
|
||||
} repeat
|
||||
} loop % file (.t.) array #refs -mark- array1 ... arrayN
|
||||
counttomark 5 add -4 roll % -mark- array1 ... arrayN file (.t.) array #refs
|
||||
|
||||
% Write the strings and names.
|
||||
% Write the content of the root array
|
||||
8 mul % -mark- array1 ... arrayN file (.t.) array #refs*8
|
||||
exch dup length 8 mul % -mark- array1 ... arrayN file (.t.) #refs*8 array len(array)*8
|
||||
3 1 roll % -mark- array1 ... arrayN file (.t.) len(array)*8 #refs*8 array
|
||||
{ 3 index % -mark- array1 ... arrayN file (.t.) len(array)*8 #refs*8 obj (.t.)
|
||||
.bosobject % -mark- array1 ... arrayN file (.t.) len(array)*8 #refs*8 (.t.)
|
||||
4 index exch writestring % -mark- array1 ... arrayN file (.t.) len(array)*8 #refs*8
|
||||
} forall
|
||||
3 -1 roll pop % -mark- array1 ... arrayN file len(array)*8 #refs*8
|
||||
|
||||
pop pop exch pop
|
||||
% Stack: -mark- array1 ... array|dictN file
|
||||
counttomark 1 sub {
|
||||
counttomark -1 roll {
|
||||
% The counting pass ensured that the keys and values
|
||||
% of any dictionary must be writable objects.
|
||||
% Hence, we are processing a dictionary iff
|
||||
% the next-to-top stack element is not a file.
|
||||
1 index type /filetype ne {
|
||||
exch 2 index exch dup type //w2dict exch .knownget
|
||||
{ exec } { pop } ifelse pop
|
||||
} if
|
||||
dup type //w2dict exch .knownget { exec } { pop } ifelse
|
||||
% Write the remaining arrays
|
||||
counttomark 2 sub -1 3 {
|
||||
index { % ... file #refs #str obj
|
||||
(1\000345678) .bosobject % ... file #refs #str (...)
|
||||
3 index exch writestring % ... file #refs #str
|
||||
} forall
|
||||
} repeat
|
||||
} for
|
||||
pop pop % -mark- array1 ... arrayN file
|
||||
|
||||
% Clean up.
|
||||
|
||||
% Stack: -mark- file
|
||||
pop pop
|
||||
% Write strings and names.
|
||||
counttomark 1 sub -1 1 {
|
||||
index {
|
||||
dup type /nametype eq {
|
||||
.namestring
|
||||
} if
|
||||
dup type /stringtype eq {
|
||||
1 index exch writestring
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
} forall
|
||||
} for
|
||||
|
||||
cleartomark % Clean up
|
||||
} .bind def
|
||||
|
||||
/.writeobject {
|
||||
|
@ -324,7 +318,6 @@ cntdict /dicttype {
|
|||
} bind def
|
||||
|
||||
currentdict /cntdict .undef
|
||||
currentdict /w2dict .undef
|
||||
|
||||
% End of level2dict
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Loader for CFF (compressed) fonts, including OpenType CFFs.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Extending Font resource category with CIDFont-CMap fonts.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define SubstCID, Decoding and CIDDecoding resource categories and related procsets.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Redefine CIDFont category with cidfmap .
|
||||
|
@ -120,7 +120,12 @@ currentdict end def
|
|||
(DroidSansFallback.ttf)
|
||||
} if
|
||||
} if
|
||||
concatstrings
|
||||
% If CIDFSubstFont looks like a path/file (rather than just file)
|
||||
% use it without the CIDFSubstPath string
|
||||
dup .file_name_directory_separator rsearch
|
||||
{pop pop pop exch pop}
|
||||
{pop concatstrings}
|
||||
ifelse
|
||||
% The CSI data just has to be valid, the substition machinery will
|
||||
% generally overwrite it with appropriate values for the missing font.
|
||||
/CSI [(Identity) 0]
|
||||
|
@ -136,7 +141,7 @@ currentdict end def
|
|||
% <dir.../base.extn> .basename <dir>
|
||||
/.splitdirname {
|
||||
(/) rsearch { //true } { (\\) rsearch } ifelse
|
||||
{3 -2 roll pop pop //true}{//false} ifelse
|
||||
{exch concatstrings exch pop //true}{//false} ifelse
|
||||
} bind def
|
||||
|
||||
% <file> .addcidfmappath -
|
||||
|
@ -209,7 +214,7 @@ currentdict end def
|
|||
} loop
|
||||
} forall
|
||||
currentdict end
|
||||
{exch pop (/) concatstrings /PermitFileReading exch .addcontrolpath} forall
|
||||
{exch pop /PermitFileReading exch .addcontrolpath} forall
|
||||
|
||||
% Checks for vicious substitution cycles.
|
||||
dup length dict copy % <<map>>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% ProcSet for implementing CIDFont and CIDMap resources.
|
||||
|
@ -36,6 +36,17 @@
|
|||
|
||||
30 dict begin
|
||||
|
||||
/.gcompatstringcopy % <string> <global> .gcompatstringcopy <string>
|
||||
{
|
||||
dup 2 index gcheck eq
|
||||
{ pop }
|
||||
{
|
||||
currentglobal 3 1 roll setglobal
|
||||
dup length string copy
|
||||
exch setglobal
|
||||
} ifelse
|
||||
} bind def
|
||||
|
||||
% The key in .cidfonttypes is the CIDFontType value;
|
||||
% the value is a procedure that takes a font name and the CIDFont dictionary
|
||||
% and replaces the latter with a real font.
|
||||
|
@ -58,7 +69,7 @@ dup 0 {
|
|||
end
|
||||
} if
|
||||
1 index exch .buildfont9
|
||||
.currentresourcefile dup type /filetype eq { //.filename {1 index exch /ResourcePath exch put} if }{ pop} ifelse
|
||||
.currentresourcefile dup type /filetype eq { //.filename {1 index gcheck //.gcompatstringcopy exec 1 index exch /ResourcePath exch put} if }{ pop} ifelse
|
||||
exch pop
|
||||
} put % Don't bind it here, because gs_fapi.ps redefines .buildfont9
|
||||
|
||||
|
@ -138,10 +149,11 @@ dup 0 {
|
|||
|
||||
% ------ CIDFontType 1 (FontType 10) ------ %
|
||||
|
||||
|
||||
dup 1 {
|
||||
10 //.checkfonttype exec pop
|
||||
1 index exch .buildfont10
|
||||
.currentresourcefile dup type /filetype eq { //.filename {1 index exch /ResourcePath exch put} if }{ pop} ifelse
|
||||
.currentresourcefile dup type /filetype eq { //.filename {1 index gcheck //.gcompatstringcopy exec 1 index exch /ResourcePath exch put} if }{ pop} ifelse
|
||||
exch pop
|
||||
} put % Don't bind it here because gs_fapi.ps redefines .buildfont10
|
||||
|
||||
|
@ -150,12 +162,15 @@ dup 1 {
|
|||
dup 2 {
|
||||
11 //.checkfonttype exec pop
|
||||
1 index exch .buildfont11
|
||||
.currentresourcefile dup type /filetype eq { //.filename {1 index exch /ResourcePath exch put} if }{ pop} ifelse
|
||||
.currentresourcefile dup type /filetype eq { //.filename {1 index gcheck //.gcompatstringcopy exec 1 index exch /ResourcePath exch put} if }{ pop} ifelse
|
||||
exch pop
|
||||
} put % Don't bind it here because gs_fapi.ps redefines .buildfont11
|
||||
|
||||
currentdict /.gcompatstringcopy .undef
|
||||
|
||||
pop % .cidfonttypes
|
||||
|
||||
|
||||
% ---------------- Reading CIDFontType 0 files ---------------- %
|
||||
|
||||
/StartData { % <(Binary)|(Hex)> <datalength> StartData -
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Redefine CIDFont category with an emulation with True Type fonts.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% ProcSet for implementing CMap resources.
|
||||
|
@ -224,11 +224,19 @@
|
|||
/beginbfchar { % <count> beginbfchar -
|
||||
pop mark
|
||||
} bind def
|
||||
/endbfchar { % <code> <to_code|charname> ... endbfchar
|
||||
counttomark 2 idiv {
|
||||
counttomark -2 roll % process in correct order
|
||||
.addbfchar
|
||||
} repeat 1 .appendmap
|
||||
/endbfchar { % [ <code> <to_code|charname> ... endbfchar
|
||||
] [ //true % [<da><ta>] [ true
|
||||
3 -1 roll % [ true [<da><ta>]
|
||||
{
|
||||
exch {
|
||||
//false % [ <da> false
|
||||
} { % [ <da> <ta>
|
||||
.addbfchar % [ prefix params key value font_index
|
||||
//true
|
||||
} ifelse
|
||||
} forall
|
||||
pop
|
||||
1 .appendmap
|
||||
} bind def
|
||||
|
||||
/beginbfrange { % <count> beginbfrange -
|
||||
|
@ -236,26 +244,35 @@
|
|||
} bind def
|
||||
/endbfrange { % <code_lo> <code_hi> <to_code|(charname*)> ...
|
||||
% endbfrange -
|
||||
counttomark 3 idiv {
|
||||
counttomark -3 roll % process in correct order
|
||||
dup type dup /arraytype eq exch /packedarraytype eq or {
|
||||
] [ 0 % [<da><ta><set>] [ 0
|
||||
3 -1 roll % [ 0 [<da><ta><set>]
|
||||
{
|
||||
exch % [ <da> 0
|
||||
{ 1 2
|
||||
{
|
||||
dup type dup /arraytype eq exch /packedarraytype eq or {
|
||||
% Array value, split up.
|
||||
exch pop {
|
||||
exch pop {
|
||||
% Stack: code to_code|charname
|
||||
1 index exch .addbfchar
|
||||
1 index exch .addbfchar
|
||||
% Increment the code. As noted above, we require
|
||||
% that only the last byte vary, but we still must
|
||||
% mask it after incrementing, in case the last
|
||||
% value was 0xff.
|
||||
% Stack: code prefix params key value fontindex
|
||||
6 -1 roll dup length string copy
|
||||
dup dup length 1 sub 2 copy get 1 add 255 and put
|
||||
} forall pop
|
||||
} {
|
||||
6 -1 roll dup length string copy
|
||||
dup dup length 1 sub 2 copy get 1 add 255 and put
|
||||
} forall pop
|
||||
} {
|
||||
% Single value, handle directly.
|
||||
.addbfrange
|
||||
} ifelse
|
||||
} repeat 1 .appendmap
|
||||
.addbfrange
|
||||
} ifelse
|
||||
0
|
||||
}
|
||||
} exch get exec
|
||||
} forall
|
||||
pop
|
||||
1 .appendmap
|
||||
} bind def
|
||||
|
||||
/.addbfchar { % <code> <to_code|charname> .addbfchar
|
||||
|
@ -349,7 +366,7 @@
|
|||
4 -1 roll % <prefix> <param'> <key> <cid>
|
||||
.endmapvalue % <prefix> <param'> <key> <hex_cid> <font_idx>
|
||||
% prefix params keys value fontindex
|
||||
counttomark 5 gt { % 2 (or more) ranges (1 range = 5 item)
|
||||
counttomark 9 gt { % 2 (or more) ranges (1 range = 5 item)
|
||||
4 index 10 index eq % compare prefix
|
||||
4 index 10 index eq and % compare params
|
||||
1 index 7 index eq and % compare fontindex
|
||||
|
@ -462,7 +479,7 @@
|
|||
% See if we can merge with the previous value.
|
||||
% The prefix, params, and font index must match.
|
||||
% prefix params keys value fontindex
|
||||
counttomark 5 gt { % 2 (or more) ranges (1 range = 5 item)
|
||||
counttomark 9 gt { % 2 (or more) ranges (1 range = 5 item)
|
||||
4 index 10 index eq % compare prefix
|
||||
4 index 10 index eq and % compare params
|
||||
1 index 7 index eq and % compare fontindex
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% basic colorspace mechanism
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the Dingbats encoding vector.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Initialization file for %disk device modifications
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Initialization file for most of the Display PostScript functions
|
||||
|
@ -95,7 +95,7 @@ level2dict begin
|
|||
if
|
||||
}
|
||||
ifelse pop
|
||||
} odef
|
||||
} .bind odef
|
||||
|
||||
% If we load a font into global VM within an inner save, the restore
|
||||
% will delete it from FontDirectory but not from SharedFontDirectory.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Initialization file for basic Display PostScript functions
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Postscript interface routines to DSC parser
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Allow the interpreter to encapsulate EPS files, to recognize MS-DOS
|
||||
|
@ -29,6 +29,7 @@
|
|||
% After %%HiResBoundingBox processed, state is 3 if OK or 4 if cropped.
|
||||
% After %%EndComments processed, state is 5.
|
||||
/EPSBoundingBoxState 5 def
|
||||
/EPSBoundingBoxString () def % set if either BoundingBox is seen (even if invalid)
|
||||
/EPSBoundingBoxSetState {
|
||||
//systemdict /EPSBoundingBoxState 3 -1 roll .forceput
|
||||
} .bind executeonly odef % .forceput must be bound and hidden
|
||||
|
@ -59,53 +60,75 @@
|
|||
% Rescale, translate and rotate to fit the BoundingBox on the page
|
||||
/EPSBoundingBoxFitPage { % llx lly urx ury --
|
||||
EPSDEBUG { (gs_epsf.ps: Rescaling EPS to fit page\n) print flush } if
|
||||
clippath pathbbox newpath
|
||||
% translate to new origin at lower left of clippath
|
||||
3 index 3 index translate
|
||||
% Figure out if rotate is needed.
|
||||
|
||||
1 index 4 index sub 1 index 4 index sub eq not {
|
||||
1 index 4 index sub 1 index 4 index sub gt % bbox page-clipbox page-is-landscape
|
||||
6 index 10 index sub 6 index 10 index sub gt % bbox page-clipbox page-is-landscape bbox-is-landscape
|
||||
xor
|
||||
}{
|
||||
//false
|
||||
}ifelse
|
||||
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
|
||||
clippath pathbbox newpath % ellx elly eurx eury pllx plly purx pury
|
||||
EPSDEBUG {
|
||||
(Page Coordinates: LLX: ) print 3 index =print (, LLY: ) print
|
||||
2 index =print (, URX: ) print 1 index =print (, URY: ) print dup = flush
|
||||
} if
|
||||
% Convert box corners to coordinates of the center and box sizes
|
||||
2 { % loop doing the page coordinates, the the EPS bbox coordinates
|
||||
3 -1 roll exch % ... llx urx lly ury
|
||||
2 { % loop doing Y then X coordnates
|
||||
2 copy exch sub % ... llx urx lly ury ury-lly
|
||||
3 1 roll % ... llx urx ury-lly lly ury
|
||||
add 2 div % ... llx urx ury-lly (lly+ury)/2
|
||||
4 2 roll % ... ury-lly (lly+ury)/2 llx urx
|
||||
} repeat
|
||||
8 4 roll
|
||||
} repeat
|
||||
% edx, edy = EPS dimension X and Y, ecx, ecy = EPS Center X and Y.
|
||||
% pdx and pcx, etc, are for the Page values.
|
||||
% edx ecx edy ecy pdx pcx pdy pcy
|
||||
|
||||
% Move the origin to the center of the printable area.
|
||||
3 -1 roll exch % edx ecx edy ecy pdx pdy pcx pcy
|
||||
translate % edx ecx edy ecy pdx pdy
|
||||
|
||||
% Find orientation of the best fit. Square pages or files don't rotate.
|
||||
2 copy sub % edx ecx edy ecy pdx pdy pdx-pdy
|
||||
EPSDEBUG {
|
||||
(pdx: ) print 2 index =print (, pdy: ) print 1 index =print
|
||||
(, pdx-pdy: ) print dup = flush
|
||||
} if
|
||||
6 index 5 index sub
|
||||
EPSDEBUG {
|
||||
(edx: ) print 7 index =print (, edy: ) print 5 index =print
|
||||
(, edx-edy: ) print dup = flush
|
||||
} if
|
||||
mul % edx ecx edy ecy pdx pdy (pdx-pdy)*(edx-edy)
|
||||
EPSDEBUG {
|
||||
(product: ) print dup = flush
|
||||
} if
|
||||
0 lt {
|
||||
90 rotate
|
||||
exch
|
||||
} 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
|
||||
4 2 roll 5 index 5 index 4 2 roll
|
||||
exch 4 -1 roll sub 3 1 roll exch sub
|
||||
4 2 roll
|
||||
exch 4 -1 roll div 3 1 roll exch div
|
||||
1 index 1 index lt {pop}{exch pop} ifelse
|
||||
dup scale
|
||||
% translate to EPS -llx,-lly
|
||||
exch neg exch neg translate
|
||||
% Finally perform the rotate if needed.
|
||||
{ clippath pathbbox pop 0 translate 90 rotate pop pop } if
|
||||
% Scale to fit in the most restricting direction.
|
||||
4 -1 roll div % edx ecx ecy pdx pdy/edy
|
||||
exch 5 -1 roll div % ecx ecy pdy/edy pdx/edx
|
||||
//.min exec
|
||||
dup scale % ecx ecy
|
||||
|
||||
% Center the document
|
||||
neg exch neg exch translate
|
||||
|
||||
} bind executeonly odef
|
||||
|
||||
/EPSBoundingBoxProcess { % (llx lly urx ury) state --
|
||||
% The following 'lt' check prioritzies HiResBoundingBox over BoundingBox
|
||||
% even if HiResBoundingBox occurs first in the EPS file.
|
||||
//systemdict /EPSBoundingBoxState get 1 index lt {
|
||||
exch EPSBoundingBoxParse
|
||||
% save the BBoxString for possible FitPage when EndComments is seen
|
||||
exch dup currentglobal //true setglobal exch
|
||||
dup length string copy //systemdict /EPSBoundingBoxString 3 -1 roll .forceput
|
||||
setglobal
|
||||
EPSBoundingBoxParse
|
||||
{
|
||||
//systemdict /EPSCrop known {
|
||||
EPSBoundingBoxCrop
|
||||
} {
|
||||
//systemdict /EPSFitPage known {
|
||||
EPSBoundingBoxFitPage
|
||||
} {
|
||||
//systemdict /EPSFitPage known not {
|
||||
% Warn if some of the EPS file will be clipped
|
||||
clippath pathbbox newpath
|
||||
{ % context for exit
|
||||
|
@ -121,10 +144,17 @@
|
|||
flush
|
||||
1 add
|
||||
} if
|
||||
} {
|
||||
pop pop pop pop
|
||||
} ifelse
|
||||
} ifelse
|
||||
EPSBoundingBoxSetState
|
||||
} {
|
||||
% improperly formed BoundingBox string.
|
||||
QUIET not {
|
||||
(\n **** Warning: BoundingBox values are invalid and will be ignored: ') print
|
||||
EPSBoundBoxString print (') = flush
|
||||
} if
|
||||
pop % state
|
||||
} ifelse
|
||||
} {
|
||||
|
@ -132,6 +162,25 @@
|
|||
} ifelse
|
||||
} bind executeonly odef
|
||||
|
||||
% Perform anchorsearch on the strings in the array until a match is found.
|
||||
/anchorsearchforany { % haystack [needle1 ...] --> post needle true
|
||||
% --> haystack false
|
||||
false 3 1 roll % false haystack [...]
|
||||
{ % false haystack needle
|
||||
dup 3 1 roll % false needle haystack needle
|
||||
anchorsearch {
|
||||
% false needle post needle
|
||||
pop % false needle post
|
||||
3 1 roll % post false needle
|
||||
exch not exch % post true needle
|
||||
exit
|
||||
} {
|
||||
% false needle haystack
|
||||
exch pop % false haystack
|
||||
} ifelse
|
||||
} forall
|
||||
exch % haystack false | post needle true
|
||||
} bind def
|
||||
|
||||
/ProcessEPSComment { % file comment -- file comment
|
||||
/EPSBoundingBoxState .systemvar 3 lt {
|
||||
|
@ -185,12 +234,23 @@
|
|||
} ifelse
|
||||
} ifelse
|
||||
} {
|
||||
(%%EndComments) anchorsearch {
|
||||
pop pop
|
||||
{(%%EndComments) (%%BeginProlog) (%%BeginSetup)} anchorsearchforany {
|
||||
EPSDEBUG { (EPSComment processing finished, encountered: ) print dup = } if
|
||||
pop pop % discard the strings from the anchorsearch
|
||||
% We may have seen BoundingBox or HiResBounfingBox. If so and if EPSFitPage
|
||||
% is set, then we do the transformation here to scale and center the page,
|
||||
% rotating if needed (and AllowFitPageRotation is true -- the default.)
|
||||
//systemdict /EPSFitPage known
|
||||
//systemdict /EPSBoundingBoxState get 0 gt
|
||||
and {
|
||||
EPSBoundingBoxString EPSBoundingBoxParse {
|
||||
EPSBoundingBoxFitPage
|
||||
} if
|
||||
} if
|
||||
% Ignore any following comments
|
||||
5 EPSBoundingBoxSetState
|
||||
} {
|
||||
pop
|
||||
pop % Not %%EndComments -- ignore it
|
||||
} ifelse
|
||||
} ifelse
|
||||
} if
|
||||
|
@ -212,13 +272,14 @@
|
|||
/.runNoEPS /run load def
|
||||
|
||||
/.runEPS { % file OR string --
|
||||
.updatematrices
|
||||
/runEPS_save save def
|
||||
/runEPS_dict_count countdictstack def
|
||||
/runEPS_op_count count 2 sub def
|
||||
/runEPS_page_count currentpagedevice /PageCount get def
|
||||
/runEPS_page_count .currentshowpagecount not {0} if def
|
||||
0 EPSBoundingBoxSetState
|
||||
//.runNoEPS
|
||||
currentpagedevice /PageCount get runEPS_page_count sub 0 eq
|
||||
.currentshowpagecount not {0} if runEPS_page_count sub 0 eq
|
||||
{ /showpage load exec } if
|
||||
count runEPS_op_count sub {pop} repeat
|
||||
countdictstack runEPS_dict_count sub {end} repeat
|
||||
|
@ -307,6 +368,7 @@ end
|
|||
/.runnoepsf
|
||||
/.runEPS
|
||||
/EPSBoundingBoxSetState
|
||||
/EPSBoundingBoxString
|
||||
/EPSBoundingBoxCrop
|
||||
/EPSBoundingBoxFitPage
|
||||
/EPSBoundingBoxParse
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Redefine Font and CIDFont categories with FAPI-handeled fonts.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% A procset for Postscript font emulation
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Font initialization and management code.
|
||||
|
@ -22,7 +22,10 @@
|
|||
% Note that the "%%Replace " comment below provides the font map file name
|
||||
% for compiling initialization files into executable. Most likely it should be
|
||||
% consistent with the one specified here.
|
||||
/defaultfontmap (Fontmap) def
|
||||
/FONTMAP where
|
||||
{/FONTMAP get /defaultfontmap exch def}
|
||||
{/defaultfontmap (Fontmap) def}
|
||||
ifelse
|
||||
|
||||
% we have to set .languagelevel to 2 so the parser will accept the names
|
||||
% '<<' and '>>', then we use a local definition here.
|
||||
|
@ -69,7 +72,7 @@ end def
|
|||
% <dir.../base.extn> .basename <dir>
|
||||
/.splitdirname {
|
||||
(/) rsearch { //true } { (\\) rsearch } ifelse
|
||||
{3 -2 roll pop pop //true}{//false} ifelse
|
||||
{exch concatstrings exch pop //true}{//false} ifelse
|
||||
} bind def
|
||||
|
||||
% <dict> .addfontmappermitpaths
|
||||
|
@ -429,6 +432,12 @@ FONTPATH
|
|||
|
||||
%END FONTPATH
|
||||
|
||||
/FONTMAP where
|
||||
{
|
||||
dup /FONTMAP get /FONTMAP exch [ exch //.pathlist exec] put
|
||||
/FONTMAP dup where pop exch get {/PermitFileReading exch .addcontrolpath} forall
|
||||
} if
|
||||
|
||||
% Try to enumerate native fonts registered with the os
|
||||
% and add them to the fontmap. This relies on a custom
|
||||
% operator which calls platform-specific C code. It
|
||||
|
@ -924,10 +933,14 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if
|
|||
} if
|
||||
% No aliasing.
|
||||
% This mode is incompatible with high level devices.
|
||||
defaultfontname /None eq { /findfont cvx /invalidfont signalerror } if
|
||||
cleartomark mark defaultfontname
|
||||
} {
|
||||
dup .substitutefont
|
||||
2 copy eq { pop defaultfontname } if
|
||||
2 copy eq {
|
||||
defaultfontname /None eq { /findfont cvx /invalidfont signalerror } if
|
||||
pop defaultfontname
|
||||
} if
|
||||
//.checkalias exec
|
||||
QUIET not {
|
||||
SHORTERRORS {
|
||||
|
@ -1056,6 +1069,25 @@ $error /SubstituteFont { } put
|
|||
//false
|
||||
}ifelse
|
||||
|
||||
% If just opening the file didn't work, try opening the file name
|
||||
% in the font resource directory
|
||||
{
|
||||
dup
|
||||
//.fonttempstring /FontResourceDir getsystemparam .genericrfn
|
||||
(r) { file } stopped {
|
||||
pop pop //true
|
||||
} {
|
||||
dup .filename
|
||||
{ 3 -1 roll pop exch }
|
||||
{ pop }
|
||||
ifelse
|
||||
//false
|
||||
} ifelse
|
||||
}
|
||||
{
|
||||
//false
|
||||
}ifelse
|
||||
|
||||
{
|
||||
QUIET not
|
||||
{ (Can't find \(or can't open\) font file ) print dup print
|
||||
|
@ -1296,7 +1328,7 @@ FAKEFONTS { exch } if pop def % don't bind, .current/setglobal get redefined
|
|||
/.loadinitialfonts
|
||||
{ NOFONTMAP not
|
||||
{ /FONTMAP where
|
||||
{ pop [ FONTMAP //.pathlist exec]
|
||||
{ pop FONTMAP
|
||||
{ dup VMDEBUG findlibfile
|
||||
{ exch pop //.loadFontmap exec }
|
||||
{ /undefinedfilename signalerror }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Implementation of ReusableStreamDecode filter.
|
||||
|
@ -61,13 +61,29 @@ level2dict begin
|
|||
|
||||
.currentglobal 1 index gcheck .setglobal exch
|
||||
currentpacking //false setpacking exch
|
||||
2 dict begin /filelen 0 def % scratch dict for filelen and pos (below).
|
||||
% Stack: dict filters parms CloseSource oldglobal oldpacking file
|
||||
[ exch { dup 40000 string readstring not { exit } if exch } loop
|
||||
[ exch {
|
||||
dup 40000 string readstring
|
||||
/filelen 2 index length filelen add def % accumulate filelen
|
||||
not { exit } if exch
|
||||
} loop
|
||||
exch pop
|
||||
]
|
||||
% Stack: dict filters parms CloseSource oldglobal oldpacking [()...]
|
||||
{ filelen string } stopped { % try allocating a single string
|
||||
pop % couldn't make a string - discard filelen value
|
||||
} {
|
||||
% transfer the array-of-strings to the single string.
|
||||
% stack: ... [() ...] string
|
||||
/pos 0 def exch {
|
||||
1 index exch pos exch putinterval /pos pos 40000 add def
|
||||
} forall
|
||||
} ifelse
|
||||
% top of stack is either array of strings or one string == stream_data
|
||||
end % done with scratch dict
|
||||
% Stack: dict filters parms CloseSource oldglobal oldpacking stream_data
|
||||
3 1 roll setpacking setglobal
|
||||
% Stack: dict filters parms CloseSource [()...]
|
||||
% Stack: dict filters parms CloseSource stream_data
|
||||
1 index .reusablestream
|
||||
} if
|
||||
% We created the stream successfully: clean up.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% We need LanguageLevel 2 or higher in order to have setuserparams and
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the ISO Latin-1 encoding vector.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2002-2018 Artifex, Inc. All rights reserved.
|
||||
% Copyright (C) 2002-2023 Artifex, Inc. All rights reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
% implied.
|
||||
|
@ -10,8 +10,8 @@
|
|||
% For more information about licensing, please refer to
|
||||
% http://www.ghostscript.com/licensing/. For information on
|
||||
% commercial licensing, go to http://www.artifex.com/licensing/ or
|
||||
% contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861.
|
||||
% contact Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA.
|
||||
|
||||
% image, colorimage, and imagemask implementation
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Initialization file for the interpreter.
|
||||
|
@ -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!
|
||||
950
|
||||
10021
|
||||
|
||||
% Check the interpreter revision.
|
||||
dup revision ne
|
||||
|
@ -144,7 +144,8 @@ currentdict /PDFNOCIDFALLBACK known /PDFNOCIDFALLBACK exch def
|
|||
|
||||
currentdict /BATCH known /BATCH exch def
|
||||
currentdict /DELAYBIND known /DELAYBIND exch def
|
||||
currentdict /DOINTERPOLATE .knownget { { -1 } { 0 } ifelse /InterpolateControl exch def } if
|
||||
currentdict /DOINTERPOLATE .knownget { { -1 } { 1 } ifelse /InterpolateControl exch def } if
|
||||
currentdict /NOINTERPOLATE .knownget { { 0 } { 1 } ifelse /InterpolateControl exch def } if
|
||||
currentdict /ESTACKPRINT known /ESTACKPRINT exch def
|
||||
currentdict /FAKEFONTS known /FAKEFONTS exch def
|
||||
currentdict /FIXEDMEDIA known /FIXEDMEDIA exch def
|
||||
|
@ -159,7 +160,6 @@ currentdict /NODISPLAY known not /DISPLAYING exch def
|
|||
currentdict /NOFONTMAP known /NOFONTMAP exch def
|
||||
currentdict /NOFONTPATH known /NOFONTPATH exch def
|
||||
currentdict /NOGC known /NOGC exch def
|
||||
currentdict /NOINTERPOLATE .knownget { /InterpolateControl 0 def } if
|
||||
currentdict /NOMEDIAATTRS known /NOMEDIAATTRS exch def
|
||||
currentdict /NOOUTERSAVE known /NOOUTERSAVE exch def
|
||||
currentdict /NOPAGEPROMPT known /NOPAGEPROMPT exch def
|
||||
|
@ -197,6 +197,11 @@ currentdict /NOSAFERERRORS known
|
|||
currentdict /SAFERERRORS known
|
||||
} ifelse def
|
||||
|
||||
currentdict /ALLOWPSTRANSPARENCY known not
|
||||
{
|
||||
/ALLOWPSTRANSPARENCY //false def
|
||||
} if
|
||||
|
||||
currentdict /SHORTERRORS known /SHORTERRORS exch def
|
||||
currentdict /TTYPAUSE known /TTYPAUSE exch def
|
||||
currentdict /WRITESYSTEMDICT known /WRITESYSTEMDICT exch def
|
||||
|
@ -210,6 +215,13 @@ 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 /PDFFitPage //true def /PSFitPage //true def } if
|
||||
|
||||
currentdict /SimulateOverprint known {
|
||||
(\n**** -dSimulateOverprint={true|false} is no longer supported. ****\n) print
|
||||
(**** It has been replaced by -dOverprint={enable|disable|simulate} ****\n\n) print
|
||||
% Set the new variable appropriately.
|
||||
/Overprint SimulateOverprint { /enable } { /disable } ifelse def
|
||||
} if
|
||||
|
||||
% Acquire environment variables.
|
||||
currentdict /DEVICE known not
|
||||
{ (GS_DEVICE) getenv { /DEVICE exch def } if } if
|
||||
|
@ -271,9 +283,7 @@ userdict /=string 256 string put
|
|||
(\)\n) revisiondate 10 mod revisiondate 10 idiv 10 mod (-)
|
||||
revisiondate 100 idiv 10 mod revisiondate 1000 idiv 10 mod (-)
|
||||
revisiondate 10000 idiv ( \()
|
||||
revision 10 mod
|
||||
revision 100 mod 10 idiv (.)
|
||||
revision 100 idiv ( )
|
||||
.revisionstring ( )
|
||||
product
|
||||
counttomark
|
||||
{ (%stdout) (w) file exch 0 .writecvp
|
||||
|
@ -315,7 +325,7 @@ DELAYBIND
|
|||
( have selected DELAYBIND. Unless you use this option with\n) print
|
||||
( care \(and specifically, remember to call .bindnow\) it is\n) print
|
||||
( possible that malicious code may be able to evade the\n) print
|
||||
( limited security offered by the SAFER option.\n) print
|
||||
( limited security offered by the SAFER option.\n) print flush
|
||||
} if
|
||||
.currentglobal //false .setglobal
|
||||
systemdict /.delaybind 2000 array .forceput
|
||||
|
@ -331,7 +341,7 @@ DELAYBIND
|
|||
{ pop /.bind cvx exec
|
||||
}
|
||||
ifelse
|
||||
} .bind def
|
||||
} .bind odef
|
||||
} executeonly if
|
||||
|
||||
.currentglobal //true .setglobal
|
||||
|
@ -464,6 +474,7 @@ userdict /#copies 1 put
|
|||
% We have to guard against the BeginPage procedure not popping its operand.
|
||||
% This is really stupid, but the Genoa CET does it.
|
||||
/.beginpage { % - .beginpage -
|
||||
.updatematrices
|
||||
.currentshowpagecount {
|
||||
.currentpagedevice pop
|
||||
dup //null ne { /BeginPage .knownget } { pop //false } ifelse {
|
||||
|
@ -479,6 +490,7 @@ userdict /#copies 1 put
|
|||
|
||||
% Guard similarly against EndPage not popping its operand.
|
||||
/.endpage { % <reason> .endpage <print_bool>
|
||||
.updatematrices
|
||||
.currentshowpagecount {
|
||||
1 index .currentpagedevice pop
|
||||
dup //null ne { /EndPage .knownget } { pop //false } ifelse {
|
||||
|
@ -880,16 +892,13 @@ currentdict /.makeinternaldict .undef
|
|||
/write= {
|
||||
1 index exch write=only (\n) writestring
|
||||
} bind def
|
||||
/=only { (%stdout) (w) file exch write=only } bind def
|
||||
/=only { (%stdout) (w) file exch write=only } bind odef
|
||||
/= { =only (\n) print } bind def
|
||||
/=print /=only load def
|
||||
% Temporarily define == as = for the sake of runlibfile0.
|
||||
/== /= load def
|
||||
|
||||
% The following procedures are documented.
|
||||
/copydevice { % <device> copydevice <newdevice>
|
||||
//false .copydevice2
|
||||
} odef
|
||||
/finddevice { % <devicename> finddevice <device>
|
||||
/devicedict .systemvar exch get
|
||||
dup 1 get //null eq {
|
||||
|
@ -897,13 +906,10 @@ currentdict /.makeinternaldict .undef
|
|||
% Create a default instance now.
|
||||
% Stack: [proto null]
|
||||
.currentglobal //true .setglobal exch
|
||||
dup dup 0 get copydevice 1 exch put
|
||||
dup dup 0 get //false .copydevice2 1 exch put
|
||||
exch .setglobal
|
||||
} if 1 get
|
||||
} bind def
|
||||
/findprotodevice { % <devicename> findprotodevice <protodevice>
|
||||
/devicedict .systemvar exch get 0 get
|
||||
} bind def
|
||||
} bind executeonly odef
|
||||
|
||||
% Run a resource file. This allows us to distinguish resource objects
|
||||
% from objects coming from input files.
|
||||
|
@ -1000,12 +1006,13 @@ currentdict /runlibfile0 .undef
|
|||
(; OffendingCommand: ) print =only ( ]%%) =
|
||||
}
|
||||
{ (Unrecoverable error: ) print =only flush
|
||||
( in ) print = flush
|
||||
( in ) print =only flush
|
||||
count 2 gt
|
||||
{ (Operand stack:\n ) print
|
||||
count 1 sub -1 2 { ( ) print index =only flush } for
|
||||
() = flush
|
||||
() =only
|
||||
} if
|
||||
(\n) =only flush
|
||||
}
|
||||
ifelse
|
||||
-1 0 1 //ErrorNames length 1 sub
|
||||
|
@ -1077,7 +1084,7 @@ currentdict /.unstoppederrorhandler .undef
|
|||
}
|
||||
{
|
||||
exch print exch % print heading. stack <==flag> <stack>
|
||||
1 index not { () = } if
|
||||
1 index not { () =only } if
|
||||
{ 1 index { (\n ) } { ( ) } ifelse print
|
||||
dup type /dicttype eq
|
||||
{
|
||||
|
@ -1116,7 +1123,7 @@ currentdict /.unstoppederrorhandler .undef
|
|||
errorname /VMerror eq
|
||||
{ (VM status:) print mark vmstatus
|
||||
counttomark { ( ) print counttomark -1 roll dup =only } repeat
|
||||
cleartomark () =
|
||||
cleartomark () =only
|
||||
} if
|
||||
|
||||
.languagelevel 2 ge
|
||||
|
@ -1127,8 +1134,8 @@ currentdict /.unstoppederrorhandler .undef
|
|||
.oserrno dup 0 ne
|
||||
{ (Last OS error: ) print
|
||||
errorname /VMerror ne
|
||||
{ dup .oserrorstring { = pop } { = } ifelse }
|
||||
{ = }
|
||||
{ dup .oserrorstring { =only pop } { =only } ifelse }
|
||||
{ =only }
|
||||
ifelse
|
||||
}
|
||||
{ pop
|
||||
|
@ -2201,6 +2208,19 @@ systemdict /EPSBoundingBoxInit .forceundef
|
|||
readonly def
|
||||
.setglobal
|
||||
|
||||
/SAFERUndefinePostScriptOperators {
|
||||
[
|
||||
% Used by our own test suite files
|
||||
/.setdotlength % Bug687720.ps
|
||||
/.sort /.setdebug /.mementolistnewblocks /getenv
|
||||
/unread
|
||||
/makeimagedevice
|
||||
]
|
||||
{systemdict exch .forceundef} forall
|
||||
|
||||
//systemdict /SAFERUndefinePostScriptOperators .forceundef
|
||||
} .bind executeonly def % must be bound and hidden for .forceundef
|
||||
|
||||
/tempfilepaths
|
||||
[
|
||||
(TMPDIR) getenv not
|
||||
|
@ -2381,27 +2401,17 @@ currentdict /.locksafe_userparams .undef
|
|||
currentdict /.setsafeglobal .undef
|
||||
currentdict /.locksafeglobal .undef
|
||||
|
||||
SAFER {
|
||||
/SAFERUndefinePostScriptOperators {
|
||||
[
|
||||
% Used by our own test suite files
|
||||
/.pushpdf14devicefilter % transparency-example.ps
|
||||
/.poppdf14devicefilter % transparency-example.ps
|
||||
/.setopacityalpha % transparency-example.ps
|
||||
/.setshapealpha % transparency-example.ps
|
||||
/.endtransparencygroup % transparency-example.ps
|
||||
/.setdotlength % Bug687720.ps
|
||||
/.sort /.setdebug /.mementolistnewblocks /getenv
|
||||
/unread
|
||||
]
|
||||
{systemdict exch .forceundef} forall
|
||||
|
||||
//systemdict /SAFERUndefinePostScriptOperators .forceundef
|
||||
} .bind executeonly def % must be bound and hidden for .forceundef
|
||||
} if
|
||||
|
||||
%% ---------------- SAFER stuff END -------------------%%
|
||||
|
||||
/UndefinePostScriptFilters {
|
||||
[
|
||||
/BCPEncode /TBCPEncode /PNGPredictorEncode /PNGPredictorDecode /PixelDifferenceDecode /PixelDifferenceEncode
|
||||
/zlibEncode /zlibDecode /PWGDecode /eexecEncode /ArcfourEncode /PSStringEncode /BCPDecode
|
||||
/OLDPDF where {/OLDPDF get not {/SHA256Encode /MD5Encode /AESDecode /JPXDecode /JBIG2Decode /ArcfourDecode /.EOFDecode} if} if
|
||||
]
|
||||
{filterdict exch undef} forall
|
||||
} .bind executeonly def
|
||||
|
||||
/UndefinePostScriptOperators {
|
||||
% This list is of operators which no longer appear to be used, and which we do not believe
|
||||
% to have any real use. For now we will undefine the operstors so they cannot easily be used
|
||||
|
@ -2410,7 +2420,7 @@ SAFER {
|
|||
[
|
||||
/.bitadd /.charboxpath /.cond /.runandhide /.popdevicefilter
|
||||
/.execfile /.filenamesplit /.file_name_parent
|
||||
/.setdefaultmatrix /.isprocfilter /.unread /.psstringencode
|
||||
/.setdefaultmatrix /.updatematrices /.isprocfilter /.unread /.psstringencode
|
||||
/.buildsampledfunction /.isencapfunction /.currentaccuratecurves /.currentcurvejoin /.currentdashadapt /.currentdotlength
|
||||
/.currentlimitclamp /.dotorientation /.setaccuratecurves /.setcurvejoin /.setdashadapt /.setdotorientation
|
||||
/.setlimitclamp /.currentscreenlevels /.dashpath /.pathbbox /.identeq /.identne /.tokenexec /.forgetsave /.pantonecallback
|
||||
|
@ -2439,10 +2449,10 @@ SAFER {
|
|||
/.getshowoperator /.getnativefonts /.beginform /.endform /.get_form_id /.repeatform /.reusablestream /.rsdparams
|
||||
/.buildfunction /.sethpglpathmode /.currenthpglpathmode
|
||||
/.currenthalftone /.sethalftone5 /.image1 /.imagemask1 /.image3 /.image4
|
||||
/.getiodevice /.getdevparms /.putdevparams /.bbox_transform /.matchmedia /.matchpagesize /.defaultpapersize
|
||||
/.getiodevice /.getdevparms /.putdevparams
|
||||
/.matchmedia /.matchpagesize /.defaultpapersize
|
||||
/.oserrno /.setoserrno /.oserrorstring /.getCPSImode
|
||||
/.getscanconverter /.setscanconverter /.type1encrypt /.type1decrypt/.languagelevel /.setlanguagelevel /.eqproc /.fillpage
|
||||
/.saslprep
|
||||
/.shfill /.argindex /.bytestring /.namestring /.stringbreak /.stringmatch /.globalvmarray /.globalvmdict /.globalvmpackedarray /.globalvmstring
|
||||
/.localvmarray /.localvmdict /.localvmpackedarray /.localvmstring /.systemvmarray /.systemvmdict /.systemvmpackedarray /.systemvmstring /.systemvmfile /.systemvmlibfile
|
||||
/.systemvmSFD /.settrapparams /.currentsystemparams /.currentuserparams /.getsystemparam /.getuserparam /.setsystemparams /.setuserparams
|
||||
|
@ -2457,7 +2467,6 @@ SAFER {
|
|||
/.init_otto_font_file
|
||||
/.composefontdict
|
||||
/.type1build
|
||||
/.origdefinefont /.origundefinefont /.origfindfont
|
||||
/.buildnativefontmap
|
||||
/.completefont
|
||||
/.definefakefonts
|
||||
|
@ -2474,6 +2483,9 @@ SAFER {
|
|||
/odef
|
||||
/.packtomark
|
||||
/.putdeviceprops
|
||||
/putdeviceprops
|
||||
/getdeviceprops
|
||||
/finddevice
|
||||
/.growdict /.growdictlength
|
||||
/.userdict /.uservar
|
||||
/.getdefaulthalftone
|
||||
|
@ -2541,6 +2553,7 @@ SAFER {
|
|||
]
|
||||
{statusdict exch .forceundef} forall
|
||||
|
||||
//systemdict /UndefinePostScriptFilters .forceundef
|
||||
//systemdict /UndefinePostScriptOperators .forceundef
|
||||
} .bind executeonly def % must be bound and hidden for .forceundef
|
||||
|
||||
|
@ -2561,6 +2574,7 @@ SAFER {
|
|||
SAFER {
|
||||
//systemdict /SAFERUndefinePostScriptOperators get exec
|
||||
} if
|
||||
//systemdict /UndefinePostScriptFilters get exec
|
||||
//systemdict /UndefinePostScriptOperators get exec
|
||||
//systemdict /.forcecopynew .forceundef % remove temptation
|
||||
//systemdict /.forceput .forceundef % ditto
|
||||
|
@ -2648,9 +2662,7 @@ FontDirectory readonly pop
|
|||
% If we are using DELAYBIND we have to defer the undefinition
|
||||
% until .bindnow.
|
||||
DELAYBIND not {
|
||||
SAFER {
|
||||
//systemdict /SAFERUndefinePostScriptOperators get exec
|
||||
} if
|
||||
//systemdict /UndefinePostScriptFilters get exec
|
||||
//systemdict /UndefinePostScriptOperators get exec
|
||||
} if
|
||||
end
|
||||
|
@ -2694,7 +2706,7 @@ WRITESYSTEMDICT {
|
|||
( care and specifically, remember to execute code like:\n) print
|
||||
( "systemdict readonly pop"\n) print
|
||||
( it is possible that malicious code may be able to evade the\n) print
|
||||
( limited security offered by the SAFER option.\n) print
|
||||
( limited security offered by the SAFER option.\n) print flush
|
||||
}if
|
||||
}
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Initialization file for Level 2 functions.
|
||||
|
@ -201,7 +201,7 @@ end
|
|||
[ /GenericResourceDir /FontResourceDir /GenericResourcePathSep ] {
|
||||
2 copy .knownget {
|
||||
exch //pssystemparams exch .knownget {
|
||||
ne { /setsystemparams /invalidaccess signalerror } if
|
||||
ne { /setsystemparams cvx /invalidaccess signalerror } if
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
|
@ -279,7 +279,7 @@ end
|
|||
/.checkFilePermitparams {
|
||||
type /arraytype eq {
|
||||
currentuserparams /LockFilePermissions get {
|
||||
5 { pop } repeat /setuserparams /invalidaccess signalerror
|
||||
5 { pop } repeat /setuserparams cvx /invalidaccess signalerror
|
||||
}{
|
||||
% in addition to validating the value, ensure the value is read/only
|
||||
dup { readonly exch } forall
|
||||
|
@ -288,7 +288,7 @@ end
|
|||
}
|
||||
ifelse
|
||||
} {
|
||||
5 { pop } repeat /setuserparams /typecheck signalerror
|
||||
5 { pop } repeat /setuserparams cvx /typecheck signalerror
|
||||
}
|
||||
ifelse
|
||||
//true
|
||||
|
@ -534,7 +534,7 @@ serverdict begin
|
|||
|
||||
/exitserver { % <password> exitserver -
|
||||
//true exch { .startnewjob } .startjob not {
|
||||
/exitserver /invalidaccess signalerror
|
||||
/exitserver cvx /invalidaccess signalerror
|
||||
} if
|
||||
} bind def
|
||||
|
||||
|
@ -621,13 +621,13 @@ currentuserparams /WaitTimeout known
|
|||
.dicttomark setpagedevice
|
||||
} bind def
|
||||
/setresolution
|
||||
{ count 1 lt { /setresolution /stackunderflow signalerror } if
|
||||
{ count 1 lt { /setresolution cvx /stackunderflow signalerror } if
|
||||
dup type dup /integertype eq exch /realtype eq or not
|
||||
{
|
||||
/setresolution /typecheck signalerror
|
||||
/setresolution cvx /typecheck signalerror
|
||||
} if
|
||||
dup 2 array astore /HWResolution //.pair2dict exec { setpagedevice } stopped {
|
||||
pop /setresolution $error /errorname get signalerror
|
||||
pop /setresolution cvx $error /errorname get signalerror
|
||||
} if
|
||||
} bind def
|
||||
%END PAGEDEVICE
|
||||
|
@ -660,7 +660,7 @@ currentuserparams /WaitTimeout known
|
|||
% Search for valid (iccprofiles) directory as a sibling to (Resource)
|
||||
% and set it as a default if found.
|
||||
LIBPATH {
|
||||
(Resource) search {
|
||||
(Resource) rsearch {
|
||||
exch pop exch pop (iccprofiles) concatstrings
|
||||
.file_name_separator concatstrings
|
||||
dup (default_gray.icc) concatstrings status {
|
||||
|
@ -1139,13 +1139,14 @@ def
|
|||
}{
|
||||
% Check that the tint is a number between 0 and 1
|
||||
dup type dup /integertype eq exch /realtype eq or not {
|
||||
/setcustomcolor /typecheck cvx signalerror
|
||||
/setcustomcolor cvx /typecheck signalerror
|
||||
} if
|
||||
% Bug 703869. Apparently Adobe (at least Acrobat Pro) silently clamps values
|
||||
dup 1 le not {
|
||||
/setcustomcolor /rangecheck cvx signalerror
|
||||
pop 1
|
||||
} if
|
||||
dup 0 ge not {
|
||||
/setcustomcolor /rangecheck cvx signalerror
|
||||
pop 0
|
||||
} if
|
||||
|
||||
% The array is supposed to be the result of fundcmykcustomcolor. Our
|
||||
|
@ -1157,20 +1158,20 @@ def
|
|||
{
|
||||
1 index exch get dup
|
||||
type dup /integertype eq exch /realtype eq or not {
|
||||
/setcustomcolor /typecheck cvx signalerror
|
||||
/setcustomcolor cvx /typecheck signalerror
|
||||
} if
|
||||
dup
|
||||
1 le not {
|
||||
/setcustomcolor /rangecheck cvx signalerror
|
||||
/setcustomcolor cvx /rangecheck signalerror
|
||||
} if
|
||||
0 ge not {
|
||||
/setcustomcolor /rangecheck cvx signalerror
|
||||
/setcustomcolor cvx /rangecheck signalerror
|
||||
} if
|
||||
} for
|
||||
|
||||
% Finally, check the last element of the array, which must be a string.
|
||||
dup length 1 sub get type /stringtype eq not {
|
||||
/setcustomcolor /typecheck cvx signalerror
|
||||
/setcustomcolor cvx /typecheck signalerror
|
||||
} if
|
||||
|
||||
exch //buildcolorspacearray exec
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Initialization file for PostScript LanguageLevel 3 functions.
|
||||
|
@ -113,9 +113,9 @@ currentdict /.bind_ undef
|
|||
} bind def
|
||||
|
||||
/.bigstring { % <size> .bigstring <string|bytestring>
|
||||
count 1 lt { /.bigstring /stackunderflow signalerror } if
|
||||
count 1 lt { /.bigstring cvx /stackunderflow signalerror } if
|
||||
dup type /integertype ne {
|
||||
/.bigstring /typecheck signalerror
|
||||
/.bigstring cvx /typecheck signalerror
|
||||
} if
|
||||
dup 65400 gt { .bytestring } { string } ifelse
|
||||
} bind def
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the MacExpert encoding vector.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% $Id: gs_mgl_e.ps 8954 2008-08-08 04:22:38Z ray $
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% $Id: gs_mro_e.ps 8954 2008-08-08 04:22:38Z ray $
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the PDFDoc encoding vector.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% PDF writer additions to systemdict.
|
||||
|
@ -86,7 +86,7 @@ languagelevel 2 .setlanguagelevel
|
|||
/MonoImageDownsampleThreshold 1.5
|
||||
/MonoImageFilter /CCITTFaxEncode
|
||||
/OffOptimizations 0
|
||||
/OPM 1
|
||||
/OPM 0
|
||||
/Optimize //true
|
||||
/ParseDSCComments //true
|
||||
/ParseDSCCommentsForDocInfo //true
|
||||
|
@ -102,6 +102,8 @@ languagelevel 2 .setlanguagelevel
|
|||
/UseFlateCompression //true
|
||||
/UsePrologue //false
|
||||
/PassThroughJPEGImages //true
|
||||
/PassThroughJPXImages //true
|
||||
/PSPageOptionsWrap //true
|
||||
.dicttomark readonly def
|
||||
|
||||
/.distillersettings mark
|
||||
|
@ -278,19 +280,6 @@ languagelevel 2 .setlanguagelevel
|
|||
|
||||
% ---------------- End of predefined configurations ---------------- %
|
||||
|
||||
% Set optimizations for converting PostScript to PDF.
|
||||
% The ps2pdf* scripts invoke this.
|
||||
/.setpdfwrite { % - .setpdfwrite -
|
||||
% Set a large VM threshold to reduce garbage collection.
|
||||
(\n**** WARNING: The .setpdfwrite operator has been deprecated and will be removed entirely\n) print
|
||||
( in the next release of Ghostscript. The functionality of this operator has\n) print
|
||||
( been reduced to increasing the size of the VM threshold. If you believe you\n) print
|
||||
( have a real need for this then you should replace your call to .setpdfwrite\n) print
|
||||
( with:\n\n) print
|
||||
( 3000000 setvmthreshold\n\n) print
|
||||
currentuserparams /VMThreshold get 3000000 .max setvmthreshold
|
||||
} bind def
|
||||
|
||||
% ---------------- pdfmark and DSC processing ---------------- %
|
||||
|
||||
/.write_small_positive_real % <file> <real> .write_small_positive_real -
|
||||
|
@ -586,10 +575,10 @@ userdict /.pdfcvstring () put
|
|||
|
||||
/pdfmark { % -mark- <key> <value> ... <markname> pdfmark -
|
||||
counttomark 0 eq {
|
||||
/pdfmark /stackunderflow signalerror
|
||||
/pdfmark cvx /stackunderflow signalerror
|
||||
} if
|
||||
dup type /nametype eq not {
|
||||
/pdfmark /typecheck signalerror
|
||||
/pdfmark cvx /typecheck signalerror
|
||||
} if
|
||||
dup /SP eq {
|
||||
% A hack for synchronizing the clipping path.
|
||||
|
@ -703,13 +692,33 @@ currentdict /.pdf_hook_DSC_Creator undef
|
|||
pop
|
||||
3000 % priority
|
||||
{
|
||||
currentglobal //true setglobal
|
||||
2 dict dup .initialize_dsc_parser readonly
|
||||
currentuserparams /ProcessDSCComment get
|
||||
1 array astore % in case the value is executable
|
||||
//.pdfdsc /exec load 4 array astore cvx readonly
|
||||
<< /ProcessDSCComment 3 -1 roll >> setuserparams
|
||||
setglobal
|
||||
% When running gpdl, due to the way gpdl has to do job encapsulation
|
||||
% the scheduled initialisation procedures get run at the start of each
|
||||
% job. Because this patches the existing procedure, it could end up
|
||||
% patching itself, so the procedure got larger/deeper with each job.
|
||||
% Eventually, copying the user params (see /.setuserparams2 in gs_lev2.ps)
|
||||
% would end up overflowing the exec stack.
|
||||
% So, as part of the patching, we push and pop a sacrificial name object
|
||||
% at the start of the executable array and before patching, we check that
|
||||
% first element, and if it is that name, we skip the patching
|
||||
currentuserparams /ProcessDSCComment .knownget
|
||||
{
|
||||
dup type /arraytype eq
|
||||
{
|
||||
0 get /.pdf_hook_DSC_Creator eq
|
||||
{ //false } { //true } ifelse
|
||||
} { //true } ifelse
|
||||
} { //true } ifelse
|
||||
|
||||
{
|
||||
currentglobal //true setglobal
|
||||
2 dict dup .initialize_dsc_parser readonly
|
||||
currentuserparams /ProcessDSCComment get
|
||||
1 array astore % in case the value is executable
|
||||
/.pdf_hook_DSC_Creator /pop load 4 2 roll //.pdfdsc /exec load 6 array astore cvx readonly
|
||||
<< /ProcessDSCComment 3 -1 roll >> setuserparams
|
||||
setglobal
|
||||
} if
|
||||
} bind .schedule_init
|
||||
} if
|
||||
|
||||
|
@ -836,8 +845,12 @@ currentdict /.pdf_hook_DSC_Creator undef
|
|||
/SubsetFonts { }
|
||||
/DSCEncodingToUnicode { }
|
||||
/PassThroughJPEGImages { }
|
||||
/PassThroughJPXImages { }
|
||||
/PSDocOptions { }
|
||||
/PSPageOptions { }
|
||||
/PSPageOptionsWrap { }
|
||||
/AlwaysOutline { }
|
||||
/NeverOutline { }
|
||||
.dicttomark readonly def
|
||||
/.distillerdevice
|
||||
{
|
||||
|
@ -886,7 +899,7 @@ currentdict /.pdf_hook_DSC_Creator undef
|
|||
//true
|
||||
}ifelse
|
||||
{
|
||||
/setdistillerparams /undefined signalerror
|
||||
/setdistillerparams cvx /undefined signalerror
|
||||
} if
|
||||
.setdistillerparams
|
||||
} bind odef
|
||||
|
@ -898,7 +911,7 @@ currentdict /.pdf_hook_DSC_Creator undef
|
|||
//true
|
||||
}ifelse
|
||||
{
|
||||
/currentdistillerparams /undefined signalerror
|
||||
/currentdistillerparams cvx /undefined signalerror
|
||||
} if
|
||||
.currentdistillerparams
|
||||
} bind odef
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Initialization file for Level 2 resource machinery.
|
||||
|
@ -284,7 +284,7 @@ systemdict begin
|
|||
dup .file_name_current eq {
|
||||
pop
|
||||
} {
|
||||
(Resource) search {
|
||||
(Resource) rsearch {
|
||||
exch concatstrings
|
||||
exch pop
|
||||
.file_name_separator concatstrings exit
|
||||
|
@ -1054,15 +1054,6 @@ currentdict /.fontstatusaux .undef
|
|||
//.definefontmap exec
|
||||
} bind def
|
||||
|
||||
% Make sure the old definitions are still in systemdict so that
|
||||
% they will get bound properly.
|
||||
% NOTE: Mystery code... I can't just delete this, but don't understand why.
|
||||
% Instead we will undef these three operators in gs_init.ps after all the initialization is done.
|
||||
systemdict begin
|
||||
/.origdefinefont /definefont load def
|
||||
/.origundefinefont /undefinefont load def
|
||||
/.origfindfont /findfont load def
|
||||
end
|
||||
/definefont {
|
||||
{ /Font defineresource } stopped {
|
||||
/definefont cvx $error /errorname get signalerror
|
||||
|
@ -1075,7 +1066,7 @@ end
|
|||
% but it still needs to restore the stacks reliably if it fails.
|
||||
/.findfontop {
|
||||
{ /Font findresource } stopped {
|
||||
pop /findfont $error /errorname get signalerror
|
||||
pop /findfont cvx $error /errorname get signalerror
|
||||
} if
|
||||
} bind executeonly odef
|
||||
/findfont {
|
||||
|
@ -1100,7 +1091,7 @@ end % level2dict
|
|||
} forall
|
||||
/.findencoding {
|
||||
{ /Encoding findresource } stopped {
|
||||
pop /findencoding $error /errorname get signalerror
|
||||
pop /findencoding cvx $error /errorname get signalerror
|
||||
} if
|
||||
} bind def
|
||||
/findencoding /.findencoding load def % must be a procedure
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% A procset to redefine a resource category with a resource map.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% The current implementation of setpagedevice has the following limitations:
|
||||
|
@ -919,7 +919,7 @@ SETPDDEBUG { (Installing.) = pstack flush } if
|
|||
.currentpagedevice pop exch
|
||||
{ .setdevice } stopped {
|
||||
cleartomark exch pop
|
||||
/setpagedevice $error /errorname get
|
||||
/setpagedevice cvx $error /errorname get
|
||||
signalerror
|
||||
} if
|
||||
pop
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% This file provides statusdict, serverdict, and assorted LaserWriter
|
||||
|
@ -42,7 +42,7 @@ statusdict begin
|
|||
|
||||
% Keep the table of named paper sizes as procedures. Reuse them later
|
||||
% as compatibility operators.
|
||||
/.pagetypeprocs 70 dict begin
|
||||
/.pagetypeprocs 81 dict begin
|
||||
|
||||
% Define various paper formats. The Adobe documentation defines only these:
|
||||
% 11x17, a3, a4, a4small, b5, ledger, legal, letter, lettersmall, note.
|
||||
|
@ -116,6 +116,11 @@ statusdict begin
|
|||
/archC {1296 1728 //.setpagesize stopped { pop pop /archC $error /errorname get signalerror } if } bind def
|
||||
/archB {864 1296 //.setpagesize stopped { pop pop /archB $error /errorname get signalerror } if } bind def
|
||||
/archA {648 864 //.setpagesize stopped { pop pop /archA $error /errorname get signalerror } if } bind def
|
||||
/archa /archA load def
|
||||
/archb /archB load def
|
||||
/archc /archC load def
|
||||
/archd /archD load def
|
||||
/arche /archE load def
|
||||
% Other paper sizes
|
||||
/flsa {612 936 //.setpagesize stopped { pop pop /flsa $error /errorname get signalerror } if } bind def % U.S. foolscap
|
||||
/flse {612 936 //.setpagesize stopped { pop pop /flse $error /errorname get signalerror } if } bind def % European foolscap
|
||||
|
@ -132,6 +137,12 @@ statusdict begin
|
|||
/ANSI_D {1585 2448 //.setpagesize stopped { pop pop /ANSI_D $error /errorname get signalerror } if } bind def
|
||||
/ANSI_E {2448 3168 //.setpagesize stopped { pop pop /ANSI_E $error /errorname get signalerror } if } bind def
|
||||
/ANSI_F {2016 2880 //.setpagesize stopped { pop pop /ANSI_F $error /errorname get signalerror } if } bind def
|
||||
/ansi_a /ANSI_A load def
|
||||
/ansi_b /ANSI_B load def
|
||||
/ansi_c /ANSI_C load def
|
||||
/ansi_d /ANSI_D load def
|
||||
/ansi_e /ANSI_E load def
|
||||
/ansi_f /ANSI_F load def
|
||||
%END SIZES
|
||||
currentdict end
|
||||
userdict begin dup { def } forall end % reuse!
|
||||
|
@ -269,10 +280,10 @@ readonly def
|
|||
% (a Level 1 operator) as accepting the values 0 and 1,
|
||||
% so we do too.
|
||||
dup type /integertype ne {
|
||||
/setpage /typecheck signalerror
|
||||
/setpage cvx /typecheck signalerror
|
||||
} {
|
||||
dup 0 ne 1 index 1 ne or {
|
||||
/setpage /rangecheck signalerror
|
||||
/setpage cvx /rangecheck signalerror
|
||||
} {
|
||||
{/letter /note} 1 index get
|
||||
//systemdict /userdict get exch get cvx exec
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the standard encoding vector.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the Symbol encoding vector.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% PostScript LanguageLevel 3 in-RIP trapping support.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Support code for direct use of TrueType fonts.
|
||||
|
@ -240,11 +240,25 @@
|
|||
% <nametable> <nameid> findname false
|
||||
/findname {
|
||||
TTFDEBUG { (findname: ) print dup =only } if
|
||||
//false 3 1 roll
|
||||
1 index length 0 gt { % check for zero length name table
|
||||
[ //false 4 2 roll
|
||||
{
|
||||
0 1 3 index 2 getu16 1 sub {
|
||||
% Stack: false table id index
|
||||
12 mul 6 add 2 index exch 12 getinterval
|
||||
12 mul 6 add 2 index exch 12
|
||||
% Check the table is actually long enough to contain the requested index
|
||||
1 index add 2 index length gt
|
||||
{
|
||||
/pdfformaterror where
|
||||
{
|
||||
( **** TrueType font has malformed name table.\n) exch /pdfformaterror get exec
|
||||
PDFSTOPONERROR {
|
||||
/.loadpdfttfont cvx /invalidfont signalerror
|
||||
} if
|
||||
} if
|
||||
pop pop
|
||||
exit
|
||||
} if
|
||||
12 getinterval
|
||||
dup 6 getu16 2 index eq 1 index 8 getu16 0 ne and {
|
||||
% We found the name we want.
|
||||
exch pop
|
||||
|
@ -265,8 +279,12 @@
|
|||
} ifelse
|
||||
} if pop
|
||||
} for
|
||||
} if
|
||||
pop pop
|
||||
} stopped {
|
||||
cleartomark //false
|
||||
} {
|
||||
pop pop
|
||||
counttomark 1 add -1 roll pop
|
||||
} ifelse
|
||||
TTFDEBUG {
|
||||
dup { ( = ) print 1 index //== exec } { ( not found) = } ifelse
|
||||
} if
|
||||
|
@ -414,7 +432,16 @@
|
|||
pop
|
||||
/firstcode startc 0 getu16a 16#ff00 and dup 16#f000 ne { pop 0 } if def
|
||||
/putglyph {
|
||||
glyphs code 3 -1 roll put /code code 1 add def
|
||||
glyphs code known
|
||||
{
|
||||
glyphs /.cmap_warning_issued known not {
|
||||
(**** Warning: Invalid TTF cmap mapping (overlapping/repeated map)\n) print flush
|
||||
glyphs /.cmap_warning_issued //true put
|
||||
} if
|
||||
pop
|
||||
}
|
||||
{glyphs code 3 -1 roll put}ifelse
|
||||
/code code 1 add def
|
||||
} bind def
|
||||
/glyphs 0 dict def
|
||||
|
||||
|
@ -438,6 +465,10 @@
|
|||
% Two choices are: drop later repeated/overlapping segments entirely,
|
||||
% or only use codes from later, overlapping segments not already set
|
||||
% by the earlier segment. (Inspired by Bug 700968).
|
||||
% Revision: bug 703589 has an (invalid) cmap table with overlapping
|
||||
% (actually repeating) ranges, and requires the *first* range definition
|
||||
% to be used in order to render correctly. So /putglyph now refuses to
|
||||
% overwrite existing keys in the "glyphs" dictionary
|
||||
0 2 nseg2 dup 4 lt {pop 4}if 3 sub {
|
||||
/i2 exch def
|
||||
/scode startc i2 getu16a def
|
||||
|
@ -464,7 +495,10 @@
|
|||
} for
|
||||
} ifelse
|
||||
} if
|
||||
} for glyphs /glyphs //null def % for GC
|
||||
} for
|
||||
% If we've encoutered an invalid table, remove the key before returning
|
||||
glyphs /.cmap_warning_issued undef
|
||||
glyphs /glyphs //null def % for GC
|
||||
} .bind
|
||||
6 { % Single interval lookup.
|
||||
dup 6 getu16a /firstcode exch def
|
||||
|
@ -1304,7 +1338,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
|
|||
TTFDEBUG { (\n1 setting alias: ) print dup ==only
|
||||
( to be the same as ) print 2 index //== exec } if
|
||||
|
||||
7 index 2 index 3 -1 roll exch .forceput
|
||||
7 index 2 index 3 -1 roll exch put
|
||||
} forall
|
||||
pop pop pop
|
||||
}
|
||||
|
@ -1322,7 +1356,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
|
|||
exch pop
|
||||
TTFDEBUG { (\n2 setting alias: ) print 1 index ==only
|
||||
( to use glyph index: ) print dup //== exec } if
|
||||
5 index 3 1 roll .forceput
|
||||
5 index 3 1 roll put
|
||||
//false
|
||||
}
|
||||
{
|
||||
|
@ -1339,7 +1373,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
|
|||
{ % CharStrings(dict) isunicode(boolean) cmap(dict) RAGL(dict) gname(name) codep(integer) gindex(integer)
|
||||
TTFDEBUG { (\3 nsetting alias: ) print 1 index ==only
|
||||
( to be index: ) print dup //== exec } if
|
||||
exch pop 5 index 3 1 roll .forceput
|
||||
exch pop 5 index 3 1 roll put
|
||||
}
|
||||
{
|
||||
pop pop
|
||||
|
@ -1369,7 +1403,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
|
|||
} ifelse
|
||||
]
|
||||
TTFDEBUG { (Encoding: ) print dup === flush } if
|
||||
} .bind executeonly odef % hides .forceput
|
||||
} .bind odef
|
||||
|
||||
% ---------------- CIDFontType 2 font loading ---------------- %
|
||||
|
||||
|
@ -1657,7 +1691,13 @@ currentdict /.pickcmap_with_no_xlatmap .undef
|
|||
/CharStrings currentdict end
|
||||
} .bind def
|
||||
|
||||
% - .pdfcharkeys /CharStrings <charstrings> /Encoding <encoding>
|
||||
% If we're using a 1,0 cmap table, we need to store the table for the heuristic
|
||||
% to know whether to image or elide GID 0. See zfapi.c ps_get_glyphname_or_cid().
|
||||
% For other cmap types, we don't. Since this just pushes key/value pairs onto the
|
||||
% stack for a later dicttomark op, it doesn't matter that different branches can push
|
||||
% different numbers of objects.
|
||||
%
|
||||
% - .pdfcharkeys [/TT_cmap cmapdict] /CharStrings <charstrings> /Encoding <encoding>
|
||||
/.pdfcharkeys {
|
||||
% The following algorithms are per the PDF 1.7 Reference.
|
||||
TTFDEBUG { (.pdfcharkeys beg) = } if
|
||||
|
@ -1736,12 +1776,13 @@ currentdict /.pickcmap_with_no_xlatmap .undef
|
|||
} ifelse
|
||||
} {
|
||||
<00010000> //.findcmap exec {
|
||||
/TT_cmap 1 index cmapdict 3 -1 roll
|
||||
TTFDEBUG { (Using cmap 1.0 for non-symbolic.) = } if
|
||||
prebuilt_encoding //null ne {
|
||||
prebuilt_encoding .invert_encoding exch .romanmacdict //.pdfmapchars exec
|
||||
prebuilt_encoding
|
||||
} {
|
||||
0 dict exch
|
||||
0 dict exch .romanmacdict //.pdfmapchars exec
|
||||
/MacRomanEncodingForTrueType .findencoding
|
||||
} ifelse
|
||||
/Encoding exch
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Initialization file for Type 32 fonts.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Type 42 font support code.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Type 1 font support code.
|
||||
|
@ -75,9 +75,10 @@
|
|||
% 16 bytes is arbitrary, but should be large enough to hold any "uniXXXX" style name
|
||||
//ReverseAdobeGlyphList //AdobeGlyphList 3 -1 roll
|
||||
% scratch(string) RAGL(dict) AGL(dict) CharStrings(dict)
|
||||
dup
|
||||
{ % scratch(string) RAGL(dict) AGL(dict) CharStrings(dict) gname cstring
|
||||
exch dup % scratch(string) RAGL(dict) AGL(dict) CharStrings(dict) cstring gname gname
|
||||
[ 1 index {pop} forall ] % scratch(string) RAGL(dict) AGL(dict) CharStrings(dict) [ glyph names ]
|
||||
{ % scratch(string) RAGL(dict) AGL(dict) CharStrings(dict) gname
|
||||
1 index 1 index get % scratch(string) RAGL(dict) AGL(dict) CharStrings(dict) cstring gname
|
||||
exch dup
|
||||
4 index exch .knownget
|
||||
{ //true}
|
||||
{ % scratch(string) RAGL(dict) AGL(dict) CharStrings(dict) cstring gname
|
||||
|
@ -86,7 +87,7 @@
|
|||
{
|
||||
% if we couldn't derive the code point from the AGL, we might derive it
|
||||
% from a formatted "uniXXXX" name.
|
||||
dup <00000000000000000000000000000000> cvs dup flush (uni) anchorsearch
|
||||
dup (0000000000000000) cvs dup (uni) anchorsearch
|
||||
{
|
||||
% as luck would have it, we can just replace the "uni" with "16#"
|
||||
% to get something we can convert to a number
|
||||
|
@ -224,6 +225,12 @@ currentdict /.loadfont1 .undef
|
|||
ifelse
|
||||
/.notdef CharStrings /.notdef get
|
||||
} if
|
||||
dup type /integertype eq
|
||||
currentdict /CFFCharStrings known and
|
||||
{
|
||||
CFFCharStrings exch .knownget not
|
||||
{ CFFCharStrings 0 get} if
|
||||
} if
|
||||
end
|
||||
} bind def
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the WinAnsi encoding vector.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,461 +0,0 @@
|
|||
% Copyright (C) 2001-2019 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.
|
||||
%
|
||||
|
||||
% pdf_rbld.ps - Rebuilding of broken PDF files (xref errors)
|
||||
|
||||
% This module contains routines that are used if we detect an error
|
||||
% while reading the xref tables. These routines will scan the file and
|
||||
% build an xref table by finding the objects. We also need to find the
|
||||
% appropriate trailer dictionary. Note: One procedure is also used
|
||||
% even if we do not need to rebuild a PDF file.
|
||||
%
|
||||
% This module cannot rebuild a PDF file which has had errors created inside
|
||||
% of objects or binary data streams. It often succeeds with files that
|
||||
% have had its end of lines converted between unix and dos versions.
|
||||
|
||||
% if true --> we have an object with duplicate object and generation numbers.
|
||||
/dup_obj_gen_num //false def
|
||||
|
||||
% Note: This procedure is also used by non-rebuild code.
|
||||
% Store a line in the xref array (Actually Objects and Generations arrays)
|
||||
% <obj num> (strm num> <obj loc> <gen num> <rebuild>
|
||||
% setxrefentry <obj num> strm num> <obj loc> <gen num>
|
||||
/setxrefentry
|
||||
{
|
||||
5 1 roll
|
||||
dup 65535 or 65535 ne {
|
||||
( **** Error: Generation number out of 0..65535 range, assuming 0.\n)
|
||||
pdfformaterror
|
||||
( Output may be incorrect.\n) pdfformaterror
|
||||
pop 0
|
||||
} if
|
||||
% We store generation numbers as value + 1
|
||||
% We reserve 0 to indicate an free xref entry
|
||||
1 add % increment generation number
|
||||
% To save space, generations numbers are stored in a string unless we
|
||||
% find a generation number greater than 255. If so then transfer to
|
||||
% an array.
|
||||
dup 255 gt {
|
||||
Generations type /stringtype eq { % Convert Generations to an array.
|
||||
Generations length array dup % Create new array
|
||||
0 1 2 index length 1 sub { % Copy from old string to new array
|
||||
Generations 1 index get put dup
|
||||
} for
|
||||
pop
|
||||
/Generations exch store % Save new Generations array
|
||||
} if
|
||||
} if
|
||||
% Verify that the new values are for a new object. If the current
|
||||
% entry is null then we have a new entry.
|
||||
Objects 4 index get //null eq {
|
||||
ObjectStream 4 index 4 index cvx put % Save ObjectStream object number
|
||||
Objects 4 index 3 index cvx put % Save object location
|
||||
Generations 4 index 2 index put % Save geenration number
|
||||
} {
|
||||
% Verify that the new entry has at least as high a generaton number
|
||||
% We accept equal entry number because we have found PDF files in
|
||||
% which there are multiple objects with the same object and entry
|
||||
% numbers. The normal xref logic only accepts the first such
|
||||
% entry that it finds. However the 'rebuild PDF' logic can find
|
||||
% both such entries. The correct one is usually the last one.
|
||||
Generations 4 index get 1 index le {
|
||||
%% Check if the object we already found was at the locaton specified
|
||||
%% in the original xref (now stored in Orig_Objects). If so, prefer
|
||||
%% that offset, otherwise prefer the later object.
|
||||
%% NB check first to see that the object number is in the range of the original
|
||||
%% xref. If it isn't, set the 'original' Offset to 0.
|
||||
3 index Orig_Objects length le {Orig_Objects 4 index get}{0}ifelse
|
||||
Objects 5 index get eq not
|
||||
{
|
||||
ObjectStream 4 index 4 index cvx put % Save ObjectStream object number
|
||||
Objects 4 index 3 index cvx put % Save object location
|
||||
Generations 4 index 2 index put % Save geenration number
|
||||
} if
|
||||
} if
|
||||
% Set error flag if we have equal object and generation numbers
|
||||
Generations 4 index get 1 index eq { /dup_obj_gen_num //true def } if
|
||||
} 8 -1 roll { ifelse } { pop if } ifelse % Run 'else' only when rebuilding.
|
||||
} bind executeonly def
|
||||
|
||||
% Print the contents of the xref array. This actually consists of three
|
||||
% arrays (Objects, Generations, and ObjectStream).
|
||||
/print_xref % - print_xref -
|
||||
{ 0 1 Objects length 1 sub % stack: 0 1 <number of objects - 1>
|
||||
{ dup =only % print object number
|
||||
( ) print
|
||||
dup Generations exch get 1 sub =only % print Generation number
|
||||
( ) print
|
||||
dup ObjectStream exch get ==only % print ObjectStream object number
|
||||
( ) print
|
||||
Objects exch get === % print object location
|
||||
} for
|
||||
flush
|
||||
} bind executeonly def
|
||||
|
||||
% Get token from string and check its type
|
||||
% <string> <type> typed_token <false> % no token or not match
|
||||
% <string> <type> typed_token <obj> <last> <true> % matching token type
|
||||
% Where last is the string remainder
|
||||
/typed_token
|
||||
{ exch
|
||||
token_nofail % get token
|
||||
{
|
||||
dup type % stack: type last token type
|
||||
4 -1 roll eq { % stack: last token bool
|
||||
exch //true % desired object found - set exit status
|
||||
} {
|
||||
pop pop //false % not type - clear stack, set exit status
|
||||
} ifelse
|
||||
} {
|
||||
pop //false % no token - pop type, set exit status
|
||||
} ifelse % check if we got token
|
||||
} bind executeonly def
|
||||
|
||||
% Allocate space for post_eof_count to be bound into procedures below.
|
||||
/post_eof_count 0 def
|
||||
|
||||
% We want the location of the trailer dictionary at the start of file.
|
||||
% First we will find the xref. Then we will skip over the xref entries
|
||||
% to the trailer.
|
||||
/search_start_trailer % - search_start_trailer <trailer loc>
|
||||
{ % Read the first 300 bytes and check for xref
|
||||
PDFfile 0 setfileposition
|
||||
PDFfile bytesavailable post_eof_count sub % location of end of data
|
||||
300 .min % block size to read
|
||||
dup string 0 1 4 -1 roll 1 sub
|
||||
{ 2 copy PDFfile read pop put pop } for
|
||||
(xref) search {
|
||||
% found 'xref'
|
||||
exch pop exch pop length 4 add PDFfile exch setfileposition
|
||||
PDFfile token pop % get starting entry - or 'trailer'
|
||||
(trailer) ne { % if we do not already have 'trailer'
|
||||
PDFfile token pop % get number of entries
|
||||
PDFfile token pop pop % this moves us into the middle of the first entry
|
||||
25 string exch % define working string for readline
|
||||
{ PDFfile 1 index readline pop pop
|
||||
} repeat % skip entries
|
||||
pop % pop working string
|
||||
PDFfile token pop pop % get 'trailer'
|
||||
PDFfile fileposition % get file position
|
||||
} if
|
||||
} {
|
||||
pop 0 % no xref, should not happen, report it upstrem
|
||||
} ifelse
|
||||
} bind executeonly def
|
||||
|
||||
|
||||
%% Searches backwards from a specified point looking for a 'trailer' keyword.
|
||||
%% position search_earlier_trailer position or 0
|
||||
%%
|
||||
%% Its is just possible that a 'trailer' keyword could straddle a buffer, in which case
|
||||
%% we wouldn't find it. Given that this only executes for broken files anyway I don't
|
||||
%% propose to worry about it at the moment, if anyone ever turns up an example we may
|
||||
%% choose to enhance this routine further.
|
||||
%%
|
||||
/search_earlier_trailer {
|
||||
{ % position
|
||||
dup 0 gt { % position bool
|
||||
dup 65535 .min exch % block_size position
|
||||
1 index sub % block_size position-block_size
|
||||
dup % block_size new_position new_position
|
||||
PDFfile exch setfileposition % block_size new position
|
||||
exch dup % new position block_size block_size
|
||||
dup string 0 1 4 -1 roll 1 sub %
|
||||
{2 copy PDFfile read pop put pop } for %
|
||||
% new_position block size (...string from file....)
|
||||
(trailer) search {
|
||||
pop
|
||||
{ search not { exit } if pop } loop
|
||||
% determine where the trailer is in the file
|
||||
% trailer loc = end loc - remaing string length
|
||||
length % new_position block size string length
|
||||
3 1 roll % string length new_position block size
|
||||
add exch sub % string length - (new_position + block size)
|
||||
} {
|
||||
pop % discard old block size
|
||||
pop 0
|
||||
} ifelse
|
||||
} {
|
||||
pop 0 exit
|
||||
}ifelse
|
||||
|
||||
%% We either have a position for a trailer, or 0 if we failed to find one
|
||||
dup 0 eq not {
|
||||
exit
|
||||
}if
|
||||
pop % renove the zero leaving the new start position
|
||||
} loop
|
||||
} bind executeonly def
|
||||
|
||||
% We want the location of the trailer dictionary at the end of file.
|
||||
% We will read the last block of data and search for the final occurance
|
||||
% of the word 'trailer'
|
||||
/search_end_trailer % - search_end_trailer <trailer loc>
|
||||
{ % Position to read block of data from the end of the file. Note: We ignore
|
||||
% anything past the last %%EOF since this is not PDF data.
|
||||
PDFfile 0 setfileposition
|
||||
PDFfile bytesavailable post_eof_count sub % location of end of data
|
||||
dup 65535 .min % block size to read
|
||||
% stack: <file end pos> <block size>
|
||||
% move file position to the start of the block
|
||||
2 copy sub PDFfile exch setfileposition
|
||||
% read block of data
|
||||
dup string 0 1 4 -1 roll 1 sub { 2 copy PDFfile read pop put pop } for
|
||||
% search for last occurance of 'trailer'
|
||||
(trailer) search {
|
||||
pop
|
||||
{ search not { exit } if pop } loop
|
||||
% determine where the trailer is in the file
|
||||
% trailer loc = end loc - remaing string length
|
||||
length sub
|
||||
} {
|
||||
pop pop 0
|
||||
} ifelse
|
||||
} bind executeonly def
|
||||
|
||||
% We want to find the trailer dictionary. There is a trailer dictionary
|
||||
% for each xref object list. We only want the trailer dictionary associated
|
||||
% with the first xref object list. In theory this can be anywhere in the
|
||||
% file. However since we are trying to repair a broken file, we cannot simply
|
||||
% follow the xref links. So we are falling back to a simple strategy. We
|
||||
% find the specified location of the first xref list. If its location is in
|
||||
% the first half of the file then we search for the first trailer dictionary
|
||||
% at the start of the file. Otherwise we search for the last trailer at the
|
||||
% end of the file.
|
||||
/search_trailer % - search_trailer -
|
||||
{ % Find the 'startxref' and associated position at the end of the file.
|
||||
% Position to read block of data from the end of the file. Note: We
|
||||
% actually end at the end of the last %%EOF since this is the end of the
|
||||
% useful PDF data. (Some files contain trailing garbage.)
|
||||
PDFfile 0 setfileposition
|
||||
PDFfile bytesavailable % size of file
|
||||
post_eof_count sub dup % location of end of last %%EOF
|
||||
dup 4096 .min % block size to read
|
||||
% stack: <useful file size> <useful file size file> <block size>
|
||||
% move file position to the start of the block
|
||||
2 copy sub PDFfile exch setfileposition
|
||||
% read block of data
|
||||
dup string 0 1 4 -1 roll 1 sub { 2 copy PDFfile read pop put pop } for
|
||||
% search for last occurance of 'startxref'
|
||||
//false % Assume that startxref not present
|
||||
exch (startxref) {
|
||||
search not { exit } if % Exit loop when no more startxref's
|
||||
pop 3 -1 roll pop //true 3 1 roll % Idicate that we have found starxref
|
||||
} loop
|
||||
exch % Exch last string and 'found' flag
|
||||
{
|
||||
% determine where the startxref is in the file
|
||||
% 'startxref' loc = end loc - remaing string length - 9 bytes
|
||||
length sub 9 sub
|
||||
% move the file to this position and read startxref and position
|
||||
% First, read the startxref token, this should not fail.
|
||||
PDFfile exch setfileposition PDFfile token
|
||||
{
|
||||
% Discard the startxref token and read the following token, which should be the offset.
|
||||
pop PDFfile token_no_close
|
||||
{
|
||||
% Now chck its an integer
|
||||
dup type /integertype eq not {
|
||||
pop
|
||||
% startxref not followed by integer. We will search the end of the file for trailer.
|
||||
PDFfilelen
|
||||
} if
|
||||
} {
|
||||
% startxref not followed by any token. We will search the end of the file for trailer.
|
||||
PDFfilelen
|
||||
} ifelse
|
||||
} {
|
||||
% No startxref token ? We will search the end of the file for trailer.
|
||||
PDFfilelen
|
||||
} ifelse
|
||||
} {
|
||||
% startxref not found. We will search the end of the file for trailer.
|
||||
pop pop PDFfilelen
|
||||
} ifelse
|
||||
% compare xref position to 1/2 the length of the file and search for trailer
|
||||
exch 2 div lt {
|
||||
search_start_trailer dup 0 eq { pop search_end_trailer } if
|
||||
} {
|
||||
search_end_trailer dup 0 eq { pop search_start_trailer } if
|
||||
} ifelse
|
||||
dup 0 eq {
|
||||
pop
|
||||
( **** Error: Trailer dictionary not found.\n) pdfformaterror
|
||||
( Output may be incorrect.\n) pdfformaterror
|
||||
}{
|
||||
% get the trailer
|
||||
dup
|
||||
PDFfile exch setfileposition % set to the specified trailer location
|
||||
/dictlevelcount 0 def
|
||||
PDFfile traileropdict .pdfrun % read trailer info
|
||||
|
||||
{
|
||||
dup /Root known not {
|
||||
( **** Warning: This trailer dictionary does not contain a /Root entry\n searching for a prior trailer.\n) pdfformatwarning
|
||||
%% remove trailer dict copy, duplicate file position, then remove the length of 'trailer' so we don't
|
||||
%% find the same one again....
|
||||
pop dup 7 sub
|
||||
search_earlier_trailer
|
||||
}{exit}ifelse
|
||||
dup 0 eq {
|
||||
pop
|
||||
( **** Error: Valid trailer not found.\n) pdfformaterror
|
||||
( Output may be incorrect.\n) pdfformaterror
|
||||
}{
|
||||
PDFfile exch setfileposition % set to the specified trailer location
|
||||
/dictlevelcount 0 def
|
||||
PDFfile traileropdict .pdfrun % read trailer info
|
||||
} ifelse
|
||||
} loop
|
||||
/Trailer exch def
|
||||
pop
|
||||
} ifelse
|
||||
} bind executeonly def
|
||||
|
||||
% This routine will determine if there is stuff after the %%EOF. There is
|
||||
% supposed to be only a line termination. However many real life files
|
||||
% contain some garbage. This routine checks how much. We then ignore this
|
||||
% stuff when we are scanning for objects.
|
||||
/determine_post_eof_count % - determine_post_eof_count <count>
|
||||
{ % Position to read block of data from the end of the file.
|
||||
PDFfilelen % size of file
|
||||
dup 4096 .min % file_size block_size
|
||||
dup 3 1 roll sub % block_size file_size-block_size
|
||||
PDFfile exch setfileposition % block_size
|
||||
string PDFfile exch readstring pop % ()
|
||||
|
||||
% search for last occurance of 'startxref', '%%EOF' is often damaged
|
||||
(startxref) search {
|
||||
pop
|
||||
{ search not { exit } if pop
|
||||
} loop
|
||||
% how much is left = remaining string length
|
||||
|
||||
% Now search for %%EO or try to read a number after 'startxref'.
|
||||
(%%EO) search {
|
||||
pop pop
|
||||
} {
|
||||
% Look for a number after startxref
|
||||
{ dup token { pop exch pop } if
|
||||
} stopped pop
|
||||
} ifelse
|
||||
length
|
||||
} {
|
||||
% Can't even find startxref, assume it's all objects
|
||||
pop 0
|
||||
} ifelse
|
||||
} bind executeonly def
|
||||
|
||||
% This routine will scan a file searaching for object locations to build
|
||||
% an alternate version of the data in the xref tables.
|
||||
% Its purpose is to provide a basis for an xref fixing facility.
|
||||
/search_objects % - search_objects -
|
||||
{ % Initialize the Objects, Generations, etc. arrays
|
||||
Objects dup length array copy /Orig_Objects exch def
|
||||
initPDFobjects
|
||||
% reset duplicate object and generation numbers error flag
|
||||
/dup_obj_gen_num //false def
|
||||
% Determine how many bytes are in the file after the final %%EOF
|
||||
/post_eof_count determine_post_eof_count def
|
||||
% Start at the beginning of the file
|
||||
PDFfile 0 setfileposition
|
||||
% Create a working string (and also store its length on stack). We are
|
||||
% using a maximum size string size the logic below wants a recovered object
|
||||
% to fit into our working string.
|
||||
65535 dup string
|
||||
{ % Now loop through the entire file looking for objects
|
||||
PDFfile fileposition % save current file position
|
||||
% When we get near the end of the file, we use a smaller interval of
|
||||
% our working string to prevent reading past the end. (See comments on
|
||||
% EOF testing below.)
|
||||
PDFfile bytesavailable post_eof_count sub 10 sub dup 4 index lt {
|
||||
2 index 0 3 -1 roll getinterval % near EOF, use interval of string
|
||||
} {
|
||||
pop 1 index % not near end, use full working string
|
||||
} ifelse
|
||||
% Read a line from file. If the line does not fit into our working string,
|
||||
% or any other error, then we will discard it.
|
||||
PDFfile exch { readline } //.internalstopped exec
|
||||
{ pop pop //false } if % indicate no string if we stopped
|
||||
{ % stack: <length> <working_str> <loc> <string>
|
||||
% Now that we have line, get obj num, ref num, and 'obj'. Verify that each
|
||||
% of these is correct type.
|
||||
dup (obj) search { % preliminary check for obj
|
||||
pop pop pop
|
||||
/integertype typed_token { % get obj number
|
||||
/integertype typed_token { % get ref number
|
||||
/nametype typed_token { % get 'obj' text
|
||||
pop % pop remaining string
|
||||
/obj eq { % verify name is 'obj'
|
||||
% make sure we have room in the arrays. We work in increments
|
||||
% of 20 each time we increase the size.
|
||||
1 index 20 add 20 idiv 20 mul
|
||||
growPDFobjects
|
||||
% save xref parameters into ObjectStream, Objects and Generations
|
||||
1 index 0 % rearrange parms for setxrefentry
|
||||
4 index PDFoffset sub 3 index
|
||||
//true setxrefentry % save parameters
|
||||
pop pop pop pop % clear parameters
|
||||
} if % check if name is 'obj'
|
||||
} if % check if we got 'obj" string
|
||||
pop % remove ref number
|
||||
} if % check if we got ref number
|
||||
pop % remove obj number
|
||||
} if % check if we got object number
|
||||
} {
|
||||
pop pop
|
||||
} ifelse
|
||||
} if % check if got a string from readline
|
||||
pop % remove location
|
||||
% Check if we are approaching the end of the file. We do not want to
|
||||
% read past the end of the file since that closes it. We actually stop
|
||||
% 10-20 bytes early since there cannot be an object that close to the end.
|
||||
% (There is a Trailer dictionary, etc. at the end of the file.)
|
||||
PDFfile bytesavailable post_eof_count sub 20 lt { exit } if
|
||||
} loop % loop through the entire file
|
||||
pop pop % remove working string and its length
|
||||
% Output warning if we have two objects with the same object and generation
|
||||
% numbers.
|
||||
dup_obj_gen_num {
|
||||
( **** Warning: There are objects with matching object and generation\n)
|
||||
pdfformatwarning
|
||||
( **** numbers. The output may be incorrect.\n)
|
||||
pdfformatwarning
|
||||
} if
|
||||
currentdict /Orig_Objects undef
|
||||
} bind executeonly def
|
||||
|
||||
% Print warning message because we found a problem while reading the xref
|
||||
% tables
|
||||
/print_xref_warning
|
||||
{ ( **** Error: An error occurred while reading an XREF table.\n)
|
||||
pdfformaterror
|
||||
( **** The file has been damaged. This may have been caused\n)
|
||||
pdfformaterror
|
||||
( **** by a problem while converting or transfering the file.\n)
|
||||
pdfformaterror
|
||||
( **** Ghostscript will attempt to recover the data.\n)
|
||||
pdfformaterror
|
||||
( **** However, the output may be incorrect.\n) pdfformaterror
|
||||
} bind executeonly def
|
||||
|
||||
% Attempt to recover the XRef data. This is called if we have a failure
|
||||
% while reading the normal XRef tables. This routine usually works
|
||||
% only for pre PDF1.5 versions of PDF files.
|
||||
/recover_xref_data % - recover_xref_data -
|
||||
{ print_xref_warning % Print warning message
|
||||
count pdfemptycount sub { pop } repeat % remove anything left by readxref
|
||||
search_objects % Search for objects
|
||||
} bind executeonly def
|
|
@ -1,754 +0,0 @@
|
|||
% Copyright (C) 2001-2019 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.
|
||||
%
|
||||
% Copyright (C) 1996-1998 Geoffrey Keating.
|
||||
% Copyright (C) 2001-2008 Artifex Software, Inc.
|
||||
% This file may be freely distributed with or without modifications,
|
||||
% so long as modified versions are marked as such and copyright notices are
|
||||
% not removed.
|
||||
|
||||
% Implementation of security hooks for PDF reader.
|
||||
|
||||
% This file contains the procedures that have to take encryption into
|
||||
% account when reading a PDF file. It was originally distributed
|
||||
% separately by Geoffrey Keating as an add-on to version 6 and earlier.
|
||||
|
||||
% Modified by Alex Cherepanov to work with GS 6.60 and higher.
|
||||
% New versions of GS require explicit checks for /true, /false, and /null
|
||||
% in .decpdfrun. This fix is backward-compatible.
|
||||
|
||||
% Modified by Raph Levien and Ralph Giles to use the new C
|
||||
% implementations of md5 and arcfour in ghostscript 7.01, and to
|
||||
% be compatible with PDF 1.4 128-bit encryption.
|
||||
|
||||
% Modified by Ralph Giles for PDF 1.6 AES encryption.
|
||||
|
||||
% Modified by Michael Constant for PDF 1.7 ExtensionLevel 3
|
||||
% AES-256 encryption.
|
||||
|
||||
/.setlanguagelevel where { pop 2 .setlanguagelevel } if
|
||||
.currentglobal //true .setglobal
|
||||
pdfdict begin
|
||||
|
||||
% Older ghostscript versions do not have .pdftoken, so we use 'token' instead.
|
||||
/.pdftoken where { pop } { /.pdftoken /token load def } ifelse
|
||||
|
||||
% take a stream and arc4 decrypt it.
|
||||
% <stream> <key> arc4decodefilter <stream>
|
||||
/arc4decodefilter {
|
||||
1 dict begin
|
||||
/Key exch def
|
||||
currentdict end /ArcfourDecode filter
|
||||
} bind executeonly def
|
||||
|
||||
% <ciphertext> <key> arc4decode <plaintext>
|
||||
/arc4decode {
|
||||
1 index length 0 eq {
|
||||
pop
|
||||
} {
|
||||
1 index length string 3 1 roll arc4decodefilter exch readstring pop
|
||||
} ifelse
|
||||
} bind executeonly def
|
||||
|
||||
% take a stream and aes decrypt it.
|
||||
% <stream> <key> aesdecodefilter <stream>
|
||||
/aesdecodefilter {
|
||||
1 dict begin
|
||||
/Key exch def
|
||||
currentdict end
|
||||
/AESDecode filter
|
||||
} bind executeonly def
|
||||
|
||||
% AES decrypt a string, returning a string. The second argument can
|
||||
% be a dictionary of the form << /Key key /Padding false >>, which
|
||||
% specifies the key and any options for the AESDecode filter, or it
|
||||
% can just be a string (the key).
|
||||
%
|
||||
% <ciphertext> <dict> aesdecode <plaintext>
|
||||
% <ciphertext> <key> aesdecode <plaintext>
|
||||
/aesdecode {
|
||||
1 index length 0 eq {
|
||||
pop
|
||||
} {
|
||||
1 index length string 3 1 roll
|
||||
|
||||
% If our second argument is a dictionary, it's the full set
|
||||
% of decoding options (including the key); pass it directly
|
||||
% to the AESDecode filter. Otherwise, it's just the key, so
|
||||
% call aesdecodefilter to construct the dictionary.
|
||||
dup type /dicttype eq { /AESDecode filter } { aesdecodefilter } ifelse
|
||||
|
||||
exch readstring pop
|
||||
} ifelse
|
||||
} bind executeonly def
|
||||
|
||||
/md5 {
|
||||
16 string dup /MD5Encode filter dup 4 3 roll writestring closefile
|
||||
} bind executeonly def
|
||||
|
||||
/md5_trunk {
|
||||
md5 0 pdf_key_length getinterval
|
||||
} bind executeonly def
|
||||
|
||||
/sha256 {
|
||||
32 string dup /SHA256Encode filter dup 4 3 roll writestring closefile
|
||||
} bind executeonly def
|
||||
|
||||
% <string> contains_non_ascii <bool>
|
||||
/contains_non_ascii {
|
||||
//false exch { 128 ge { pop //true exit } if } forall
|
||||
} bind executeonly def
|
||||
|
||||
/pdf_padding_string
|
||||
<28bf4e5e4e758a41 64004e56fffa0108
|
||||
2e2e00b6d0683e80 2f0ca9fe6453697a>
|
||||
def
|
||||
|
||||
% Pad a key out to 32 bytes.
|
||||
/pdf_pad_key { % <key> pdf_pad_key <padded key>
|
||||
dup length 32 gt { 0 32 getinterval } if
|
||||
pdf_padding_string
|
||||
0 32 3 index length sub getinterval
|
||||
concatstrings
|
||||
} bind executeonly def
|
||||
|
||||
/pdf_xorbytes { % <iter-num> <key> pdf_xorbytes <xored-key>
|
||||
dup length dup string
|
||||
exch 1 sub 0 1 3 2 roll {
|
||||
% <iter-num> <key> <new-key> <byte-num>
|
||||
dup 3 index exch get 4 index xor
|
||||
% <iter-num> <key> <new-key> <byte-num> <byte>
|
||||
3 copy put pop pop
|
||||
} for
|
||||
3 1 roll pop pop
|
||||
} bind executeonly def
|
||||
|
||||
% Get length of encryption key in bytes
|
||||
/pdf_key_length { % pdf_key_length <key_length>
|
||||
Trailer /Encrypt oget
|
||||
dup /V knownoget not { 0 } if 1 eq
|
||||
{ pop 5 } % If V == 1 then always use 40 bits
|
||||
{ /Length knownoget { -3 bitshift } { 5 } ifelse }
|
||||
ifelse
|
||||
} bind executeonly def
|
||||
|
||||
% Algorithm 3.2
|
||||
/pdf_compute_encryption_key { % <password> pdf_compute_encryption_key <key>
|
||||
% Step 1.
|
||||
pdf_pad_key
|
||||
|
||||
% Step 2, 3.
|
||||
Trailer /Encrypt oget dup /O oget
|
||||
% <padded-key> <encrypt> <O>
|
||||
|
||||
% Step 4.
|
||||
exch /P oget 4 string exch
|
||||
2 copy 255 and 0 exch put
|
||||
2 copy -8 bitshift 255 and 1 exch put
|
||||
2 copy -16 bitshift 255 and 2 exch put
|
||||
2 copy -24 bitshift 255 and 3 exch put pop
|
||||
% <padded-key> <O> <P>
|
||||
|
||||
% Step 5.
|
||||
Trailer /ID knownoget { 0 oget } {
|
||||
()
|
||||
( **** Error: ID key in the trailer is required for encrypted files.\n) pdfformaterror
|
||||
( File may not be possible to decrypt.\n) pdfformaterror
|
||||
} ifelse
|
||||
3 { concatstrings } repeat
|
||||
% We will finish step 5 after possibly including step 6.
|
||||
|
||||
% The following only executed for /R equal to 3 or more
|
||||
Trailer /Encrypt oget dup /R oget dup 3 ge {
|
||||
|
||||
% Step 6. If EncryptMetadata is false, pass 0xFFFFFFFF to md5 function
|
||||
% The PDF 1.5 Spec says that EncryptMetadata is an undocumented
|
||||
% feature of PDF 1.4. That implies that this piece of logic should
|
||||
% be executed if R >= 3. However testing with Acrobat 5.0 and 6.0 shows
|
||||
% that this step is not executed if R equal to 3. Thus we have a test for
|
||||
% R being >= 4.
|
||||
4 ge {
|
||||
/EncryptMetadata knownoget % Get EncryptMetadata (if present)
|
||||
not { //true } if % Default is true
|
||||
not { % If EncryptMetadata is false
|
||||
<ff ff ff ff> concatstrings % Add 0xFFFFFFFF to working string
|
||||
} if
|
||||
} {
|
||||
pop % Remove Encrypt dict
|
||||
} ifelse
|
||||
md5_trunk % Finish step 5 and 6.
|
||||
|
||||
% Step 7. Executed as part of step 6
|
||||
% Step 8. (This step is defintely a part of PDF 1.4.)
|
||||
50 { md5_trunk } repeat
|
||||
} {
|
||||
pop pop md5_trunk % Remove R, Encrypt dict, finish step 5
|
||||
} ifelse
|
||||
|
||||
% Step 9 - Done in md5_trunk.
|
||||
} bind executeonly def
|
||||
|
||||
% Algorithm 3.4
|
||||
/pdf_gen_user_password_R2 { % <filekey> pdf_gen_user_password_R2 <U>
|
||||
|
||||
% Step 2.
|
||||
pdf_padding_string exch arc4decode
|
||||
} bind executeonly def
|
||||
|
||||
% Algorithm 3.5
|
||||
/pdf_gen_user_password_R3 { % <filekey> pdf_gen_user_password_R3 <U>
|
||||
|
||||
% Step 2.
|
||||
pdf_padding_string
|
||||
|
||||
% Step 3.
|
||||
Trailer /ID knownoget { 0 oget } {
|
||||
()
|
||||
( **** Error: ID key in the trailer is required for encrypted files.\n) pdfformaterror
|
||||
( File may not be possible to decrypt.\n) pdfformaterror
|
||||
} ifelse
|
||||
concatstrings md5
|
||||
|
||||
% Step 4.
|
||||
1 index arc4decode
|
||||
|
||||
% Step 5.
|
||||
1 1 19 {
|
||||
2 index pdf_xorbytes arc4decode
|
||||
} for
|
||||
exch pop
|
||||
|
||||
} bind executeonly def
|
||||
|
||||
/pdf_gen_user_password { % <password> pdf_gen_user_password <filekey> <U>
|
||||
% common Step 1 of Algorithms 3.4 and 3.5.
|
||||
pdf_compute_encryption_key dup
|
||||
|
||||
Trailer /Encrypt oget
|
||||
|
||||
/R oget dup 2 eq {
|
||||
pop pdf_gen_user_password_R2
|
||||
} {
|
||||
dup 3 eq {
|
||||
pop pdf_gen_user_password_R3
|
||||
} {
|
||||
dup 4 eq { % 4 uses the algorithm as 3
|
||||
pop pdf_gen_user_password_R3
|
||||
} {
|
||||
% This procedure is only used if R is between 2 and 4,
|
||||
% so we should never get here.
|
||||
/pdf_gen_user_password cvx /undefined signalerror
|
||||
} ifelse
|
||||
} ifelse
|
||||
} ifelse
|
||||
} bind executeonly def
|
||||
|
||||
% Algorithm 3.6
|
||||
% <password> pdf_check_pre_r5_user_password <filekey> true
|
||||
% <password> pdf_check_pre_r5_user_password false
|
||||
/pdf_check_pre_r5_user_password {
|
||||
pdf_gen_user_password
|
||||
|
||||
Trailer /Encrypt oget /U oget
|
||||
|
||||
0 2 index length getinterval eq {
|
||||
//true
|
||||
} {
|
||||
pop //false
|
||||
} ifelse
|
||||
} bind executeonly def
|
||||
|
||||
% Compute an owner key, ie the result of step 4 of Algorithm 3.3
|
||||
/pdf_owner_key % <password> pdf_owner_key <owner-key>
|
||||
{
|
||||
% Step 1.
|
||||
pdf_pad_key
|
||||
|
||||
% Step 2.
|
||||
md5_trunk
|
||||
|
||||
% 3.3 Step 3. Only executed for /R equal to 3 or more
|
||||
Trailer /Encrypt oget /R oget 3 ge {
|
||||
50 { md5_trunk } repeat
|
||||
} if
|
||||
|
||||
% Step 4 - Done in md5_trunk.
|
||||
} bind executeonly def
|
||||
|
||||
% Algorithm 3.7
|
||||
% <password> pdf_check_pre_r5_owner_password <filekey> true
|
||||
% <password> pdf_check_pre_r5_owner_password false
|
||||
/pdf_check_pre_r5_owner_password {
|
||||
% Step 1.
|
||||
pdf_owner_key
|
||||
|
||||
% Step 2.
|
||||
Trailer /Encrypt oget dup /O oget 2 index arc4decode
|
||||
% <encryption-key> <encrypt-dict> <decrypted-O>
|
||||
|
||||
% Step 3. Only executed for /R equal to 3 or more
|
||||
exch /R oget 3 ge {
|
||||
1 1 19 {
|
||||
2 index pdf_xorbytes arc4decode
|
||||
} for
|
||||
} if
|
||||
exch pop
|
||||
% <result-of-step-3>
|
||||
|
||||
pdf_check_pre_r5_user_password
|
||||
} bind executeonly def
|
||||
|
||||
% Algorithm 3.2a
|
||||
% <password> pdf_check_r5_password <filekey> true
|
||||
% <password> pdf_check_r5_password false
|
||||
/pdf_check_r5_password {
|
||||
10 dict begin % temporary dict for local variables
|
||||
|
||||
% Step 1.
|
||||
% If the .saslprep operator isn't available (because ghostscript
|
||||
% wasn't built with libidn support), just skip this step. ASCII
|
||||
% passwords will still work fine, and even most non-ASCII passwords
|
||||
% will be okay; any non-ASCII passwords that fail will produce a
|
||||
% warning from pdf_process_Encrypt.
|
||||
/.saslprep where { pop .saslprep } if
|
||||
|
||||
% Step 2.
|
||||
dup length 127 gt { 0 127 getinterval } if
|
||||
/Password exch def
|
||||
|
||||
% Step 3.
|
||||
/O Trailer /Encrypt oget /O oget def
|
||||
/U Trailer /Encrypt oget /U oget def
|
||||
|
||||
Password O 32 8 getinterval concatstrings
|
||||
U 0 48 getinterval concatstrings sha256
|
||||
|
||||
O 0 32 getinterval eq {
|
||||
% Step 3, second paragraph.
|
||||
|
||||
Password O 40 8 getinterval concatstrings
|
||||
U 0 48 getinterval concatstrings sha256
|
||||
|
||||
16 string Trailer /Encrypt oget /OE oget concatstrings
|
||||
<< /Key 4 -1 roll /Padding //false >> aesdecode //true
|
||||
} {
|
||||
% Step 4.
|
||||
Password U 32 8 getinterval concatstrings sha256
|
||||
U 0 32 getinterval eq {
|
||||
% Step 4, second paragraph.
|
||||
Password U 40 8 getinterval concatstrings sha256
|
||||
|
||||
16 string Trailer /Encrypt oget /UE oget concatstrings
|
||||
<< /Key 4 -1 roll /Padding //false >> aesdecode //true
|
||||
} {
|
||||
//false
|
||||
} ifelse
|
||||
} ifelse
|
||||
|
||||
% Step 5.
|
||||
dup {
|
||||
% Adobe says to decrypt the Perms string using "ECB mode with
|
||||
% an initialization vector of zero", which must be a mistake --
|
||||
% ECB mode doesn't use initialization vectors. It looks like
|
||||
% they meant "ECB mode, or CBC mode with an initialization
|
||||
% vector of zero", since the two are equivalent for a single-
|
||||
% block message. We use the latter.
|
||||
16 string Trailer /Encrypt oget /Perms oget concatstrings
|
||||
<< /Key 4 index /Padding //false >> aesdecode
|
||||
|
||||
9 3 getinterval (adb) eq not {
|
||||
( **** Error: Failed to decrypt Perms string.\n) pdfformaterror
|
||||
( Cannot decrypt PDF file.\n) pdfformaterror
|
||||
printProducer
|
||||
/pdf_check_r5_password cvx /rangecheck signalerror
|
||||
} if
|
||||
} if
|
||||
|
||||
end
|
||||
} bind executeonly def
|
||||
|
||||
% <password> pdf_check_password <filekey> true
|
||||
% <password> pdf_check_password false
|
||||
/pdf_check_password {
|
||||
% If R is 2, 3, or 4, use Algorithms 3.6 and 3.7 to see if this is
|
||||
% a valid user or owner password. Following historical practice,
|
||||
% we treat the password as an arbitrary string of bytes and don't
|
||||
% interpret it in any way. (If the password fails, it would be
|
||||
% nice to try some plausible character set conversions, but this
|
||||
% gets complicated. Even Adobe products don't seem to handle it
|
||||
% consistently.)
|
||||
%
|
||||
% If R is 5, use Algorithm 3.2a. The password should be text, in
|
||||
% either UTF-8 or the current locale's charset.
|
||||
|
||||
Trailer /Encrypt oget /R oget
|
||||
|
||||
dup dup 2 ge exch 4 le and {
|
||||
pop
|
||||
dup pdf_check_pre_r5_user_password {
|
||||
exch pop //true
|
||||
} {
|
||||
pdf_check_pre_r5_owner_password
|
||||
} ifelse
|
||||
} {
|
||||
dup 5 eq {
|
||||
pop
|
||||
% First, try the password as UTF-8.
|
||||
dup pdf_check_r5_password {
|
||||
exch pop //true
|
||||
} {
|
||||
% The password didn't work as UTF-8, so maybe it's in the
|
||||
% locale character set instead. If possible, convert it to
|
||||
% UTF-8 and try again.
|
||||
/.locale_to_utf8 where {
|
||||
pop .locale_to_utf8 pdf_check_r5_password
|
||||
} {
|
||||
pop //false
|
||||
} ifelse
|
||||
} ifelse
|
||||
} {
|
||||
dup 6 eq {
|
||||
pop
|
||||
% First, try the password as UTF-8.
|
||||
dup Trailer /Encrypt oget //check_r6_password exec {
|
||||
exch pop //true
|
||||
} {
|
||||
% The password didn't work as UTF-8, so maybe it's in the
|
||||
% locale character set instead. If possible, convert it to
|
||||
% UTF-8 and try again.
|
||||
/.locale_to_utf8 where {
|
||||
pop .locale_to_utf8 Trailer /Encrypt oget //check_r6_password exec
|
||||
} {
|
||||
pop //false
|
||||
} ifelse
|
||||
} ifelse
|
||||
} {
|
||||
( **** Warning: This file uses an unknown standard security handler revision: )
|
||||
exch =string cvs concatstrings (\n) concatstrings pdfformatwarning
|
||||
( Cannot decrypt PDF file.\n) pdfformaterror
|
||||
printProducer
|
||||
/pdf_check_password cvx /undefined signalerror
|
||||
} ifelse
|
||||
} ifelse
|
||||
} ifelse
|
||||
} bind executeonly def
|
||||
systemdict /check_r6_password .forceundef
|
||||
|
||||
% Process the encryption information in the Trailer.
|
||||
/pdf_process_Encrypt {
|
||||
Trailer /Encrypt oget
|
||||
/Filter oget /Standard eq not {
|
||||
( **** Warning: This file uses an unknown security handler.\n) pdfformatwarning
|
||||
( Cannot decrypt PDF file.\n) pdfformaterror
|
||||
printProducer
|
||||
/pdf_process_Encrypt cvx /undefined signalerror
|
||||
} if
|
||||
() pdf_check_password
|
||||
{
|
||||
/FileKey exch def
|
||||
} {
|
||||
/PDFPassword where {
|
||||
pop PDFPassword pdf_check_password
|
||||
{
|
||||
/FileKey exch def
|
||||
} {
|
||||
( **** Error: Password did not work.\n) pdfformaterror
|
||||
( Cannot decrypt PDF file.\n) pdfformaterror
|
||||
|
||||
% If ghostscript was built without libidn, it's missing the
|
||||
% .saslprep operator and thus can't do proper Unicode password
|
||||
% normalization. Similarly, if the system provides neither
|
||||
% iconv nor the Windows MultiByteToWideChar function, then we
|
||||
% won't have the .locale_to_utf8 operator to convert passwords
|
||||
% from the locale character set to UTF-8.
|
||||
%
|
||||
% It's not a huge problem if you're missing either or both of
|
||||
% these. ASCII passwords will work fine regardless, and even
|
||||
% Unicode passwords will often be okay.
|
||||
%
|
||||
% However, if .saslprep or .locale_to_utf8 is missing, and the
|
||||
% user enters a non-ASCII password that doesn't work, we give
|
||||
% a warning message.
|
||||
PDFPassword contains_non_ascii {
|
||||
/.saslprep where not {
|
||||
( **** WARNING: Ghostscript was configured without libidn,\n)
|
||||
( **** so non-ASCII passwords aren't supported!\n)
|
||||
concatstrings pdfformaterror
|
||||
} {
|
||||
pop
|
||||
/.locale_to_utf8 where not {
|
||||
( **** WARNING: Ghostscript was configured without iconv,\n)
|
||||
( **** so non-ASCII passwords aren't supported!\n)
|
||||
concatstrings pdfformaterror
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
} ifelse
|
||||
} if
|
||||
|
||||
/pdf_process_Encrypt cvx /invalidfileaccess signalerror
|
||||
} ifelse
|
||||
} {
|
||||
( **** This file requires a password for access.\n) pdfformaterror
|
||||
/pdf_process_Encrypt cvx /invalidfileaccess signalerror
|
||||
} ifelse
|
||||
} ifelse
|
||||
|
||||
% Trailer /Encrypt oget /P oget 4 and 0 eq #? and
|
||||
% { ( ****This owner of this file has requested you do not print it.\n)
|
||||
% pdfformaterror printProducer
|
||||
% /pdf_process_Encrypt cvx /invalidfileaccess signalerror
|
||||
% }
|
||||
% if
|
||||
} bind executeonly def
|
||||
|
||||
% Calculate the key used to decrypt an object (to pass to .decpdfrun or
|
||||
% put into a stream dictionary).
|
||||
/computeobjkey % <object#> <generation#> computeobjkey <keystring>
|
||||
{
|
||||
Trailer /Encrypt oget /V oget 5 eq {
|
||||
% Encrypt version 5 doesn't use object keys; everything is
|
||||
% encrypted with the file key.
|
||||
pop pop FileKey
|
||||
} {
|
||||
exch
|
||||
FileKey length 5 add string
|
||||
dup 0 FileKey putinterval
|
||||
exch
|
||||
% stack: gen# string obj#
|
||||
2 copy 255 and FileKey length exch put
|
||||
2 copy -8 bitshift 255 and FileKey length 1 add exch put
|
||||
2 copy -16 bitshift 255 and FileKey length 2 add exch put
|
||||
pop exch
|
||||
2 copy 255 and FileKey length 3 add exch put
|
||||
2 copy -8 bitshift 255 and FileKey length 4 add exch put
|
||||
pop
|
||||
% this step is for the AES cipher only
|
||||
Trailer /Encrypt oget
|
||||
dup /StmF knownoget {
|
||||
%% Treat StmF of 'Identity' the same as if it is missing.
|
||||
dup /Identity eq {
|
||||
pop pop
|
||||
} {
|
||||
exch /CF knownoget {
|
||||
exch oget /CFM oget /AESV2 eq {
|
||||
(sAlT) concatstrings
|
||||
} if
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
} ifelse
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
md5 0 FileKey length 5 add 2 index length .min getinterval
|
||||
} ifelse
|
||||
} bind executeonly def
|
||||
|
||||
% As .pdfrun, but decrypt strings with key <key>.
|
||||
/PDFScanRules_true << /PDFScanRules //true >> def
|
||||
/PDFScanRules_null << /PDFScanRules //null >> def
|
||||
/.decpdfrun % <file> <keystring> <opdict> .decpdfrun -
|
||||
{ % Construct a procedure with the file, opdict and key bound into it.
|
||||
2 index cvlit mark
|
||||
/PDFScanRules .getuserparam //null eq {
|
||||
//PDFScanRules_true { setuserparams } 0 get % force PDF scanning mode
|
||||
mark 7 4 roll
|
||||
} {
|
||||
mark 5 2 roll
|
||||
} ifelse
|
||||
{ .pdftoken not { (%%EOF) cvn cvx } if
|
||||
dup xcheck
|
||||
{ PDFDEBUG { dup //== exec flush } if
|
||||
3 -1 roll pop
|
||||
2 copy .knownget
|
||||
{ exch pop exch pop exec
|
||||
}
|
||||
{ exch pop
|
||||
dup /true eq
|
||||
{ pop //true
|
||||
}
|
||||
{ dup /false eq
|
||||
{ pop //false
|
||||
}
|
||||
{ dup /null eq
|
||||
{ pop //null
|
||||
}
|
||||
{ ( **** Error: Unknown operator: )
|
||||
exch =string cvs concatstrings (\n) concatstrings
|
||||
pdfformaterror
|
||||
( Output may be incorrect.\n) pdfformaterror
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
{ exch pop PDFDEBUG { dup ==only ( ) print flush } if
|
||||
dup type /stringtype eq
|
||||
{
|
||||
% Check if we have encrypted strings R>=4 allows for
|
||||
% selection of encryption on streams and strings
|
||||
Trailer /Encrypt oget % Get encryption dictionary
|
||||
dup /R oget 4 lt % only >=4 has selectable
|
||||
{ % R < 4 --> arc4 strings
|
||||
pop 1 index arc4decode % Decrypt string
|
||||
PDFDEBUG { (%Decrypted: ) print dup //== exec flush } if
|
||||
} { % Else R >= 4
|
||||
/StrF knownoget % Get StrF (if present)
|
||||
{ % If StrF is present ...
|
||||
dup /Identity eq not % Check if StrF != Identity
|
||||
{ /StdCF eq
|
||||
{ Trailer /Encrypt oget /CF knownoget {
|
||||
/StdCF oget /CFM oget
|
||||
dup /AESV2 eq exch /AESV3 eq or
|
||||
} {
|
||||
//false
|
||||
} ifelse { % Decrypt string
|
||||
1 index aesdecode
|
||||
} {
|
||||
1 index arc4decode
|
||||
} ifelse
|
||||
}
|
||||
{ 1 index arc4decode }
|
||||
ifelse % If StrF != StdCF
|
||||
PDFDEBUG { (%Decrypted: ) print dup //== exec flush } if
|
||||
}
|
||||
{ pop }
|
||||
ifelse % If StrF != identity
|
||||
}
|
||||
if % If StrF is known
|
||||
}
|
||||
ifelse % Ifelse R < 4
|
||||
} {
|
||||
dup type /nametype eq {
|
||||
.pdffixname
|
||||
} if
|
||||
}
|
||||
ifelse
|
||||
exch pop
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
aload pop //.packtomark exec cvx
|
||||
{ loop } 0 get 2 packedarray cvx
|
||||
{ stopped } 0 get
|
||||
/PDFScanRules .getuserparam //null eq {
|
||||
//PDFScanRules_null { setuserparams } 0 get % reset PDF scannig mode if it was off
|
||||
} if
|
||||
/PDFsource PDFsource
|
||||
{ store { stop } if } aload pop //.packtomark exec cvx
|
||||
/PDFsource 3 -1 roll store exec
|
||||
} bind executeonly def
|
||||
currentdict /PDFScanRules_true undef
|
||||
currentdict /PDFScanRules_null undef
|
||||
|
||||
% Run the code to resolve an object reference.
|
||||
/pdf_run_resolve
|
||||
{ /FileKey where % Check if the file is encrypted
|
||||
{ pop % File is encrypted
|
||||
2 copy computeobjkey dup 4 1 roll
|
||||
PDFfile exch resolveopdict .decpdfrun
|
||||
dup dup dup 5 2 roll
|
||||
% stack: object object key object object
|
||||
{ % Use loop to provide an exitable context.
|
||||
xcheck exch type /dicttype eq and % Check if executable dictionary
|
||||
not { % If object is not ...
|
||||
pop pop % ignore object
|
||||
exit % Exit 'loop' context
|
||||
} if % If not possible stream
|
||||
% Starting with PDF 1.4 (R = 3), there are some extra features
|
||||
% which control encryption of streams. The EncryptMetadata entry
|
||||
% in the Encrypt dict controls the encryption of metadata streams.
|
||||
Trailer /Encrypt oget % Get encryption dictionary
|
||||
dup /R oget dup 3 lt % Only PDF 1.4 and higher has options
|
||||
{ % R < 3 --> all streams encrypted
|
||||
pop pop /StreamKey exch put % Insert StreamKey in dictionary
|
||||
exit % Exit 'loop' context
|
||||
} if
|
||||
% Check EncryptMeta. stack: object object key Encrypt R
|
||||
exch dup /EncryptMetadata knownoget % Get EncryptMetadata (if present)
|
||||
not { //true } if % If not present default = true
|
||||
not % Check if EncryptMetadata = false
|
||||
{ % if false we need to check the stream type
|
||||
3 index /Type knownoget % Get stream type (if present)
|
||||
not { //null } if % If type not present use fake name
|
||||
/Metadata eq % Check if the type is Metadata
|
||||
{ pop pop pop pop % Type == Metadata --> no encryption
|
||||
exit % Exit 'loop' context
|
||||
} if
|
||||
} if
|
||||
% PDF 1.5 encryption (R == 4) has selectable encryption handlers. If
|
||||
% this is not PDF 1.5 encryption (R < 4) then we are done checking and
|
||||
% we need to decrypt the stream. stack: object object key R Encrypt
|
||||
exch 4 lt % Check for less than PDF 1.5
|
||||
{ pop /StreamKey exch put % Insert StreamKey in dictionary
|
||||
exit % Exit 'loop' context
|
||||
} if
|
||||
% Check if the stream encryption handler (StmF) == Identity.
|
||||
PDFDEBUG {
|
||||
Trailer /Encrypt oget /CF knownoget {
|
||||
/StdCF oget /CFM oget
|
||||
(Encrypt StmF is StdCF with CFM ) print =
|
||||
} if
|
||||
} if
|
||||
/StmF knownoget % Get StmF (if present)
|
||||
not { /Identity } if % If StmF not present default = Identity
|
||||
/Identity eq % Check if StmF == Identity
|
||||
{ pop pop % Identity --> no encryption
|
||||
exit % Exit 'loop' context
|
||||
} if
|
||||
% If we get here then we need to decrypt the stream.
|
||||
/StreamKey exch put % Insert StreamKey into dictionary
|
||||
exit % Exit 'loop' context, never loop
|
||||
} loop % End of loop exitable context
|
||||
} { % Else file is not encrypted
|
||||
PDFfile resolveopdict .pdfrun
|
||||
} ifelse % Ifelse encrypted
|
||||
} bind executeonly def
|
||||
|
||||
% Prefix a decryption filter to a stream if needed.
|
||||
% Stack: readdata? dict parms file/string filternames
|
||||
% (both before and after).
|
||||
/pdf_decrypt_stream
|
||||
{ 3 index /StreamKey known % Check if the file is encrypted
|
||||
{
|
||||
exch
|
||||
% Stack: readdata? dict parms filternames file/string
|
||||
3 index /StreamKey get
|
||||
Trailer /Encrypt oget
|
||||
dup /StmF knownoget
|
||||
{ % stack: key Encrypt StmF
|
||||
exch /CF knownoget {
|
||||
exch oget /CFM oget % stack: key StmF-CFM
|
||||
dup /AESV2 eq exch /AESV3 eq or
|
||||
} { pop //false } ifelse
|
||||
{ aesdecodefilter } % install the requested filter
|
||||
{ arc4decodefilter }
|
||||
ifelse
|
||||
}
|
||||
{ pop arc4decodefilter } % fallback for no StmF
|
||||
ifelse
|
||||
exch
|
||||
} if
|
||||
} bind executeonly def
|
||||
|
||||
end % pdfdict
|
||||
|
||||
systemdict /pdfdict .forceundef % hide pdfdict
|
||||
|
||||
.setglobal
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% $Id:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% $Id:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% $Id:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
% Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% All Rights Reserved.
|
||||
%
|
||||
% This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
% of the license contained in the file LICENSE in this distribution.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
% CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% $Id:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
/* Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
of the license contained in the file LICENSE in this distribution.
|
||||
|
||||
Refer to licensing information at http://www.artifex.com or contact
|
||||
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
CA 94129, USA, for further information.
|
||||
*/
|
||||
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
|||
#define ARCH_ALIGN_SHORT_MOD @ARCH_ALIGN_SHORT_MOD@
|
||||
#define ARCH_ALIGN_INT_MOD @ARCH_ALIGN_INT_MOD@
|
||||
#define ARCH_ALIGN_LONG_MOD @ARCH_ALIGN_LONG_MOD@
|
||||
#define ARCH_ALIGN_SIZE_T_MOD @ARCH_ALIGN_SIZE_T_MOD@
|
||||
#define ARCH_ALIGN_PTR_MOD @ARCH_ALIGN_PTR_MOD@
|
||||
#define ARCH_ALIGN_FLOAT_MOD @ARCH_ALIGN_FLOAT_MOD@
|
||||
#define ARCH_ALIGN_DOUBLE_MOD @ARCH_ALIGN_DOUBLE_MOD@
|
||||
|
@ -30,11 +31,13 @@
|
|||
#define ARCH_LOG2_SIZEOF_INT @ARCH_LOG2_SIZEOF_INT@
|
||||
#define ARCH_LOG2_SIZEOF_LONG @ARCH_LOG2_SIZEOF_LONG@
|
||||
#define ARCH_LOG2_SIZEOF_LONG_LONG @ARCH_LOG2_SIZEOF_LONG_LONG@
|
||||
#define ARCH_LOG2_SIZEOF_SIZE_T @ARCH_LOG2_SIZEOF_SIZE_T@
|
||||
#define ARCH_LOG2_SIZEOF_PTR @ARCH_LOG2_SIZEOF_PTR@
|
||||
#define ARCH_LOG2_SIZEOF_FLOAT @ARCH_LOG2_SIZEOF_FLOAT@
|
||||
#define ARCH_LOG2_SIZEOF_DOUBLE @ARCH_LOG2_SIZEOF_DOUBLE@
|
||||
|
||||
#define ARCH_SIZEOF_PTR @ARCH_SIZEOF_PTR@
|
||||
#define ARCH_SIZEOF_SIZE_T @ARCH_SIZEOF_SIZE_T@
|
||||
#define ARCH_SIZEOF_FLOAT @ARCH_SIZEOF_FLOAT@
|
||||
#define ARCH_SIZEOF_DOUBLE @ARCH_SIZEOF_DOUBLE@
|
||||
|
||||
|
@ -44,6 +47,7 @@
|
|||
#define ARCH_MAX_USHORT ((unsigned short)~(unsigned short)0 + (unsigned short)0)
|
||||
#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
|
||||
#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
|
||||
#define ARCH_MAX_SIZE_T ((size_t)~0L + (size_t)0)
|
||||
|
||||
/* ---------------- Floating point ---------------- */
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define ARCH_ALIGN_SHORT_MOD 2
|
||||
#define ARCH_ALIGN_INT_MOD 4
|
||||
#define ARCH_ALIGN_LONG_MOD 4
|
||||
#define ARCH_ALIGN_SIZE_T_MOD 4
|
||||
#define ARCH_ALIGN_PTR_MOD 4
|
||||
#define ARCH_ALIGN_FLOAT_MOD 4
|
||||
#define ARCH_ALIGN_DOUBLE_MOD 4
|
||||
|
@ -17,7 +18,9 @@
|
|||
#define ARCH_LOG2_SIZEOF_SHORT 1
|
||||
#define ARCH_LOG2_SIZEOF_INT 2
|
||||
#define ARCH_LOG2_SIZEOF_LONG 2
|
||||
#define ARCH_LOG2_SIZEOF_SIZE_T 2
|
||||
#define ARCH_LOG2_SIZEOF_LONG_LONG 3
|
||||
#define ARCH_SIZEOF_SIZE_T 4
|
||||
|
||||
#ifndef ARCH_SIZEOF_GX_COLOR_INDEX
|
||||
#define ARCH_SIZEOF_GX_COLOR_INDEX 8
|
||||
|
@ -35,6 +38,7 @@
|
|||
#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
|
||||
#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
|
||||
#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
|
||||
#define ARCH_MAX_SIZE_T ((size_t)~0L + (size_t)0)
|
||||
|
||||
/* ---------------- Miscellaneous ---------------- */
|
||||
|
||||
|
@ -53,6 +57,7 @@
|
|||
#define ARCH_ALIGN_SHORT_MOD 2
|
||||
#define ARCH_ALIGN_INT_MOD 4
|
||||
#define ARCH_ALIGN_LONG_MOD 8
|
||||
#define ARCH_ALIGN_SIZE_T_MOD 8
|
||||
#define ARCH_ALIGN_PTR_MOD 8
|
||||
#define ARCH_ALIGN_FLOAT_MOD 4
|
||||
#define ARCH_ALIGN_DOUBLE_MOD 8
|
||||
|
@ -63,7 +68,9 @@
|
|||
#define ARCH_LOG2_SIZEOF_SHORT 1
|
||||
#define ARCH_LOG2_SIZEOF_INT 2
|
||||
#define ARCH_LOG2_SIZEOF_LONG 3
|
||||
#define ARCH_LOG2_SIZEOF_SIZE_T 3
|
||||
#define ARCH_LOG2_SIZEOF_LONG_LONG 3
|
||||
#define ARCH_SIZEOF_SIZE_T 8
|
||||
|
||||
#ifndef ARCH_SIZEOF_GX_COLOR_INDEX
|
||||
#define ARCH_SIZEOF_GX_COLOR_INDEX 8
|
||||
|
@ -81,6 +88,7 @@
|
|||
#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
|
||||
#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
|
||||
#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
|
||||
#define ARCH_MAX_SIZE_T ((size_t)~0L + (size_t)0)
|
||||
|
||||
/* ---------------- Miscellaneous ---------------- */
|
||||
|
||||
|
@ -96,6 +104,7 @@
|
|||
#define ARCH_ALIGN_SHORT_MOD 2
|
||||
#define ARCH_ALIGN_INT_MOD 4
|
||||
#define ARCH_ALIGN_LONG_MOD 4
|
||||
#define ARCH_ALIGN_SIZE_T_MOD 4
|
||||
#define ARCH_ALIGN_PTR_MOD 4
|
||||
#define ARCH_ALIGN_FLOAT_MOD 4
|
||||
#define ARCH_ALIGN_DOUBLE_MOD 4
|
||||
|
@ -106,7 +115,9 @@
|
|||
#define ARCH_LOG2_SIZEOF_SHORT 1
|
||||
#define ARCH_LOG2_SIZEOF_INT 2
|
||||
#define ARCH_LOG2_SIZEOF_LONG 2
|
||||
#define ARCH_LOG2_SIZEOF_SIZE_T 2
|
||||
#define ARCH_LOG2_SIZEOF_LONG_LONG 3
|
||||
#define ARCH_SIZEOF_SIZE_T 4
|
||||
|
||||
#ifndef ARCH_SIZEOF_GX_COLOR_INDEX
|
||||
#define ARCH_SIZEOF_GX_COLOR_INDEX 8
|
||||
|
@ -124,6 +135,7 @@
|
|||
#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
|
||||
#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
|
||||
#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
|
||||
#define ARCH_MAX_SIZE_T ((size_t)~0L + (size_t)0)
|
||||
|
||||
/* ---------------- Miscellaneous ---------------- */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
/* Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
of the license contained in the file LICENSE in this distribution.
|
||||
|
||||
Refer to licensing information at http://www.artifex.com or contact
|
||||
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
CA 94129, USA, for further information.
|
||||
*/
|
||||
/* Parameters derived from machine and compiler architecture. */
|
||||
/* This file was generated mechanically by genarch.c, for a 32bit */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
/* Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
of the license contained in the file LICENSE in this distribution.
|
||||
|
||||
Refer to licensing information at http://www.artifex.com or contact
|
||||
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
CA 94129, USA, for further information.
|
||||
*/
|
||||
/* Parameters derived from machine and compiler architecture. */
|
||||
/* This file was generated mechanically by genarch.c, for a 64bit */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
/* Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
of the license contained in the file LICENSE in this distribution.
|
||||
|
||||
Refer to licensing information at http://www.artifex.com or contact
|
||||
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
CA 94129, USA, for further information.
|
||||
*/
|
||||
/* Parameters derived from machine and compiler architecture. */
|
||||
/* This file was generated mechanically by genarch.c, for a 32bit */
|
||||
|
|
48
autogen.sh
48
autogen.sh
|
@ -1,6 +1,10 @@
|
|||
#!/bin/sh
|
||||
# Run this to set up the build system: configure, makefiles, etc.
|
||||
|
||||
#
|
||||
# NOCONFIGURE
|
||||
# If set to any value it will generate all files but not invoke the
|
||||
# generated configure script.
|
||||
# e.g. NOCONFIGURE=1 ./autogen.sh
|
||||
|
||||
package="ghostscript"
|
||||
|
||||
|
@ -17,16 +21,40 @@ cd "$srcdir"
|
|||
exit 1
|
||||
}
|
||||
|
||||
(automake --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have automake installed to compile $package."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
||||
exit 1
|
||||
}
|
||||
|
||||
rm -rf autom4te.cache
|
||||
|
||||
echo "Generating configuration files for $package, please wait...."
|
||||
|
||||
echo " running autoconf"
|
||||
autoconf || exit 1
|
||||
|
||||
if test -z "$*"; then
|
||||
echo "I am going to run ./configure with no arguments - if you wish "
|
||||
echo "to pass any to it, please specify them on the $0 command line."
|
||||
else
|
||||
echo "running ./configure $@"
|
||||
if test ! -x config.guess -o ! -x config.sub ; then
|
||||
rm -f config.guess config.sub
|
||||
cp `automake --print-libdir`/config.guess . || exit 1
|
||||
cp `automake --print-libdir`/config.sub . || exit 1
|
||||
fi
|
||||
|
||||
$srcdir/configure "$@" && echo
|
||||
if test ! -x install-sh ; then
|
||||
rm -f install-sh
|
||||
cp `automake --print-libdir`/install-sh . || exit 1
|
||||
fi
|
||||
|
||||
echo " running autoreconf"
|
||||
autoreconf || exit 1
|
||||
|
||||
|
||||
if test x"$NOCONFIGURE" = x""; then
|
||||
if test -z "$*"; then
|
||||
echo "I am going to run ./configure with no arguments - if you wish "
|
||||
echo "to pass any to it, please specify them on the $0 command line."
|
||||
else
|
||||
echo "running ./configure $@"
|
||||
fi
|
||||
|
||||
$srcdir/configure "$@" && echo
|
||||
fi
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
# Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
# of the license contained in the file LICENSE in this distribution.
|
||||
#
|
||||
# Refer to licensing information at http://www.artifex.com or contact
|
||||
# Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
# CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
# Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
# CA 94129, USA, for further information.
|
||||
#
|
||||
#
|
||||
#
|
||||
|
@ -44,7 +44,7 @@
|
|||
# Usage:
|
||||
# make <arch-name> TARGETS='...'
|
||||
#
|
||||
# or, for convenience at Utah,
|
||||
# or, for convenience at Utah,
|
||||
#
|
||||
# make `hostname`
|
||||
#
|
||||
|
@ -665,7 +665,7 @@ sgi-mips-irix6.1: init
|
|||
XINCLUDE=-I/usr/include/X11 \
|
||||
XLIBDIRS='-L/usr/local/lib -L/usr/lib/X11'
|
||||
|
||||
#
|
||||
#
|
||||
sgi-mips-irix6.3: init
|
||||
$(MAKE) $(ARGS) \
|
||||
CC='cc $(SGIARCHFLAGS) -D_POSIX_4SOURCE ' \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
/* Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
of the license contained in the file LICENSE in this distribution.
|
||||
|
||||
Refer to licensing information at http://www.artifex.com or contact
|
||||
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
CA 94129, USA, for further information.
|
||||
*/
|
||||
|
||||
/* A wrapper for providing assert() in ghosctscript code. Any changes
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
/* Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
of the license contained in the file LICENSE in this distribution.
|
||||
|
||||
Refer to licensing information at http://www.artifex.com or contact
|
||||
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
CA 94129, USA, for further information.
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
/* Copyright (C) 2016-2018 Artifex Software, Inc.
|
||||
/* Copyright (C) 2001-2023 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 that
|
||||
license. 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.
|
||||
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., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
CA 94129, USA, for further information.
|
||||
*/
|
||||
|
||||
#ifdef BOBBIN
|
||||
|
@ -298,7 +300,7 @@ static int Bobbin_thread(void *thread)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < bobbins.num_threads; i++)
|
||||
if (BOBBIN_THREAD_EQUAL(bobbins.thread[i].thread, thread) &&
|
||||
if (BOBBIN_THREAD_EQUAL(bobbins.thread[i].thread, thread) &&
|
||||
(bobbins.thread[i].flags & BOBBIN_THREAD_FINISHED) == 0)
|
||||
break;
|
||||
if (i == bobbins.num_threads)
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
/* Copyright (C) 2016-2018 Artifex Software, Inc.
|
||||
/* Copyright (C) 2001-2023 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 that
|
||||
license. 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.
|
||||
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., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
CA 94129, USA, for further information.
|
||||
*/
|
||||
|
||||
/* Bobbin: A library to aid debugging/performance tuning of threads.
|
||||
|
|
32
base/cal.mak
32
base/cal.mak
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2019 Artifex Software, Inc.
|
||||
# Copyright (C) 2019-2022 Artifex Software, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -56,13 +56,20 @@ cal_OBJS = \
|
|||
$(CAL_OBJ)$(CAL_PREFIX)blendavx2.$(OBJ) \
|
||||
$(CAL_OBJ)$(CAL_PREFIX)blendsse42.$(OBJ)\
|
||||
$(CAL_OBJ)$(CAL_PREFIX)blend.$(OBJ) \
|
||||
$(CAL_OBJ)$(CAL_PREFIX)skew.$(OBJ) \
|
||||
$(CAL_OBJ)$(CAL_PREFIX)deskew.$(OBJ) \
|
||||
$(CAL_OBJ)$(CAL_PREFIX)cmsavx2.$(OBJ) \
|
||||
$(CAL_OBJ)$(CAL_PREFIX)cmssse42.$(OBJ) \
|
||||
$(CAL_OBJ)$(CAL_PREFIX)cmsneon.$(OBJ) \
|
||||
$(CAL_OBJ)$(CAL_PREFIX)lcms2mt_cal.$(OBJ)
|
||||
|
||||
cal_HDRS = \
|
||||
$(CAL_SRC)cal.h \
|
||||
$(CAL_SRC)cal-impl.h \
|
||||
$(CAL_SRC)cal-impl.h \
|
||||
$(CAL_SRC)cal-immintrin.h \
|
||||
$(CAL_SRC)cal-nmmintrin.h \
|
||||
$(arch_h)
|
||||
|
||||
# external link .dev - empty, as we add the lib to LDFLAGS
|
||||
#$(GLOBJ)cal.dev : $(CAL_MAK) $(ECHOGS_XE) \
|
||||
|
@ -75,7 +82,7 @@ $(GLOBJ)cal.dev : $(ECHOGS_XE) $(cal_OBJS) \
|
|||
$(SETMOD) $(GLOBJ)cal $(cal_OBJS)
|
||||
|
||||
# define our specific compiler
|
||||
CAL_CC=$(CC) $(CFLAGS) $(CAL_CFLAGS) $(D_)OPJ_STATIC$(_D) $(D_)STANDARD_SLOW_VERSION$(_D) $(I_)$(CAL_GEN)$(_I) $(I_)$(CAL_SRC)$(_I)
|
||||
CAL_CC=$(CC) $(CCFLAGS) $(CAL_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)include $(I_)$(CAL_GEN)$(_I) $(I_)$(CAL_SRC)$(_I)
|
||||
CAL_O=$(O_)$(CAL_OBJ)$(CAL_PREFIX)
|
||||
|
||||
CAL_DEP=$(AK) $(CAL_MAK) $(MAKEDIRS)
|
||||
|
@ -96,13 +103,16 @@ $(CAL_OBJ)$(CAL_PREFIX)doubler.$(OBJ) : $(CAL_SRC)doubler.c $(cal_HDRS) $(CAL_DE
|
|||
$(CAL_CC) $(CAL_SSE4_2_CFLAGS) $(CAL_NEON_CFLAGS) $(CAL_O)doubler.$(OBJ) $(C_) $(CAL_SRC)doubler.c
|
||||
|
||||
$(CAL_OBJ)$(CAL_PREFIX)cmsavx2.$(OBJ) : $(CAL_SRC)cmsavx2.c $(cal_HDRS) $(CAL_DEP)
|
||||
$(CAL_CC) $(CAL_AVX2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)include $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)cmsavx2.$(OBJ) $(C_) $(CAL_SRC)cmsavx2.c
|
||||
$(CAL_CC) $(CAL_AVX2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)cmsavx2.$(OBJ) $(C_) $(CAL_SRC)cmsavx2.c
|
||||
|
||||
$(CAL_OBJ)$(CAL_PREFIX)cmssse42.$(OBJ) : $(CAL_SRC)cmssse42.c $(cal_HDRS) $(CAL_DEP)
|
||||
$(CAL_CC) $(CAL_SSE4_2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)include $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)cmssse42.$(OBJ) $(C_) $(CAL_SRC)cmssse42.c
|
||||
$(CAL_CC) $(CAL_SSE4_2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)cmssse42.$(OBJ) $(C_) $(CAL_SRC)cmssse42.c
|
||||
|
||||
$(CAL_OBJ)$(CAL_PREFIX)cmsneon.$(OBJ) : $(CAL_SRC)cmsneon.c $(cal_HDRS) $(CAL_DEP)
|
||||
$(CAL_CC) $(CAL_SSE4_2_CFLAGS) $(CAL_NEON_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)cmsneon.$(OBJ) $(C_) $(CAL_SRC)cmsneon.c
|
||||
|
||||
$(CAL_OBJ)$(CAL_PREFIX)lcms2mt_cal.$(OBJ) : $(CAL_SRC)lcms2mt_cal.c $(cal_HDRS) $(CAL_DEP) $(gsmemory_h)
|
||||
$(CAL_CC) $(I_)$(LCMS2MTSRCDIR)$(D)include $(I_)$(GLSRC) $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)lcms2mt_cal.$(OBJ) $(C_) $(CAL_SRC)lcms2mt_cal.c
|
||||
$(CAL_CC) $(I_)$(GLSRC) $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)lcms2mt_cal.$(OBJ) $(C_) $(CAL_SRC)lcms2mt_cal.c
|
||||
|
||||
$(CAL_OBJ)$(CAL_PREFIX)blendavx2.$(OBJ) : $(CAL_SRC)blendavx2.c $(cal_HDRS) $(CAL_DEP) $(gxblend_h)
|
||||
$(CAL_CC) $(CAL_AVX2_CFLAGS) $(I_)$(GLSRC) $(CAL_O)blendavx2.$(OBJ) $(C_) $(CAL_SRC)blendavx2.c
|
||||
|
@ -113,5 +123,17 @@ $(CAL_OBJ)$(CAL_PREFIX)blendsse42.$(OBJ) : $(CAL_SRC)blendsse42.c $(cal_HDRS) $(
|
|||
$(CAL_OBJ)$(CAL_PREFIX)blend.$(OBJ) : $(CAL_SRC)blend.c $(cal_HDRS) $(CAL_DEP) $(gsmemory_h)
|
||||
$(CAL_CC) $(I_)$(GLSRC) $(CAL_O)blend.$(OBJ) $(C_) $(CAL_SRC)blend.c
|
||||
|
||||
$(CAL_OBJ)$(CAL_PREFIX)skew.$(OBJ) : $(CAL_SRC)skew.c $(cal_HDRS) $(CAL_DEP) $(gsmemory_h)
|
||||
$(CAL_CC) $(CAL_SSE4_2_CFLAGS) $(I_)$(GLSRC) $(CAL_O)skew.$(OBJ) $(C_) $(CAL_SRC)skew.c
|
||||
|
||||
$(CAL_OBJ)$(CAL_PREFIX)deskew.$(OBJ) : $(CAL_SRC)deskew.c $(cal_HDRS) $(CAL_DEP) $(gsmemory_h)
|
||||
$(CAL_CC) $(CAL_SSE4_2_CFLAGS) $(CAL_NEON_CFLAGS) $(I_)$(GLSRC) $(CAL_O)deskew.$(OBJ) $(C_) $(CAL_SRC)deskew.c
|
||||
|
||||
cal_ets_h=$(CAL_SRC)cal_ets.h
|
||||
ca_ets_tm_h=$(CAL_SRC)cal_ets_tm.h
|
||||
$(GLOBJ)ets_1.$(OBJ) : $(CAL_SRC)cal_ets.c $(CAL_SRC)ets_template.c \
|
||||
$(cal_ets_h) $(cal_ets_tm_h) $(cal_HDRS) $(CAL_DEP) $(LIB_MAK)
|
||||
$(GLCC) $(CAL_SSE4_2_CFLAGS) $(CAL_NEON_CFLAGS) $(GLO_)ets_1.$(OBJ) $(C_) $(CAL_SRC)cal_ets.c
|
||||
|
||||
|
||||
# end of file
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2019 Artifex Software, Inc.
|
||||
/* Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
of the license contained in the file LICENSE in this distribution.
|
||||
|
||||
Refer to licensing information at http://www.artifex.com or contact
|
||||
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
CA 94129, USA, for further information.
|
||||
*/
|
||||
|
||||
#ifndef CLAPTRAP_IMPL_H
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2015-2018 Artifex Software, Inc.
|
||||
/* Copyright (C) 2015-2023 Artifex Software, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
This software is provided AS-IS with no warranty, either express or
|
||||
|
@ -9,8 +9,8 @@
|
|||
of the license contained in the file LICENSE in this distribution.
|
||||
|
||||
Refer to licensing information at http://www.artifex.com or contact
|
||||
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
|
||||
CA 94945, U.S.A., +1(415)492-9861, for further information.
|
||||
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
CA 94129, USA, for further information.
|
||||
*/
|
||||
|
||||
#include "claptrap.h"
|
||||
|
@ -45,8 +45,8 @@ ClapTrap *ClapTrap_Init(gs_memory_t *mem,
|
|||
ct->y = 0;
|
||||
ct->span = width * num_comps;
|
||||
|
||||
ct->linebuf = gs_alloc_bytes(mem, ct->span * ct->lines_in_buf, "ClapTrap linebuf");
|
||||
ct->process = gs_alloc_bytes(mem, ct->width * ct->lines_in_buf, "ClapTrap process");
|
||||
ct->linebuf = gs_alloc_bytes(mem, (size_t)ct->span * ct->lines_in_buf, "ClapTrap linebuf");
|
||||
ct->process = gs_alloc_bytes(mem, (size_t)ct->width * ct->lines_in_buf, "ClapTrap process");
|
||||
if (ct->linebuf == NULL || ct->process == NULL)
|
||||
{
|
||||
gs_free_object(mem, ct->linebuf, "ClapTrap linebuf");
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue