summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNancy Durgin <nancy.durgin@artifex.com>2019-01-16 12:55:22 -0800
committerNancy Durgin <nancy.durgin@artifex.com>2019-01-24 08:21:44 -0800
commit2905c901244a3c105560a48ae3047196961920d7 (patch)
treede2ef95ba43e1ebdc9a717de37c27092f143507c
parente7ff64cf9b756278f19c87d295ee0fd95c955c05 (diff)
downloadghostpdl-2905c901244a3c105560a48ae3047196961920d7.tar.gz
Undef internal operators from gs_cff.ps
- rearranged some code in gs_cff.ps to have things defined before used - /.init_wOFF_otto_font_file is only used locally, undef right after use - /.init_otto_font_file is used by pdf_fonts.ps, undef in gs_init.ps /.init_otto_font_file was being defined after it was used, because gs_cff.ps was run after pdf_fonts.ps. Need to define before using, in order to be able to undef, so had to change psi/int.mak to load gs_cff.ps before pdf_fonts.ps. Also moved around the cff.dev dependencies accordingly. NOTE: To see what order the files will be loaded, you can look at obj/iconfig.h which is generated by the makefile magic. You can also look at the INITFILES array in gs_init.ps, which the stuff in iconfig.h eventually generates.
-rw-r--r--Resource/Init/gs_cff.ps60
-rw-r--r--Resource/Init/gs_init.ps1
-rw-r--r--psi/int.mak12
3 files changed, 39 insertions, 34 deletions
diff --git a/Resource/Init/gs_cff.ps b/Resource/Init/gs_cff.ps
index 33d5ac87a..125906132 100644
--- a/Resource/Init/gs_cff.ps
+++ b/Resource/Init/gs_cff.ps
@@ -33,33 +33,6 @@
% Load a font file that might be an OpenType CFF font set.
-% <file> .loadfontfile -
-/.loadnonottofontfile /.loadfontfile load def
-/.loadfontfile {
- dup (12345678) .peekstring pop (wOFFOTTO) eq
- {
- .init_wOFF_otto_font_file
- //true //false
- }{//true} ifelse
-
- {
- dup 4 string .peekstring pop (OTTO) eq
- {
- % If this is a font at all, it's an OpenType CFF font set.
- .init_otto_font_file //true
- }
- { //false } ifelse
- } if
-
- { % Use a random FontSet resource name. ****** WRONG ******
- realtime rand xor =string cvs exch //false //false
- ReadData pop
- } {
- % Not a TrueType font.
- .loadnonottofontfile
- } ifelse
-} bind def
-
% <file> .init_otto_font_file <file>
/.init_otto_font_file {
/FontSetInit /ProcSet findresource begin
@@ -79,7 +52,7 @@
exch 3 -1 roll 1 add 16 mul 12 add sub
f exch subfilefilter flushfile % skip to start
f exch subfilefilter end
-} bind def
+} .bind executeonly odef
% <file> .init_otto_font_file <file>
/.init_wOFF_otto_font_file {
@@ -116,8 +89,37 @@
{ pop f exch subfilefilter /FlateDecode filter} ifelse
end
} bind def
-20 dict begin
+% <file> .loadfontfile -
+/.loadnonottofontfile /.loadfontfile load def
+/.loadfontfile {
+ dup (12345678) .peekstring pop (wOFFOTTO) eq
+ {
+ //.init_wOFF_otto_font_file exec
+ //true //false
+ }{//true} ifelse
+
+ {
+ dup 4 string .peekstring pop (OTTO) eq
+ {
+ % If this is a font at all, it's an OpenType CFF font set.
+ .init_otto_font_file //true
+ }
+ { //false } ifelse
+ } if
+
+ { % Use a random FontSet resource name. ****** WRONG ******
+ realtime rand xor =string cvs exch //false //false
+ ReadData pop
+ } {
+ % Not a TrueType font.
+ .loadnonottofontfile
+ } ifelse
+} bind executeonly def
+
+currentdict /.init_wOFF_otto_font_file .forceundef
+
+20 dict begin
% ------ Utilities ------ %
/subfilefilter { % <file> <length> subfilefilter <filter>
diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps
index d7b1268d9..3d500dc5a 100644
--- a/Resource/Init/gs_init.ps
+++ b/Resource/Init/gs_init.ps
@@ -2272,6 +2272,7 @@ SAFER { .setsafeglobal } if
/.currentmatrix /.setmatrix
/.setlinecap /.setlinejoin /.sizeimagebox /.systemvmcheck
/.forceinterp_exit /.actonuel
+ /.init_otto_font_file
% Used by a free user in the Library of Congress. Apparently this is used to
% draw a partial page, which is then filled in by the results of a barcode
diff --git a/psi/int.mak b/psi/int.mak
index 5dfb66ca7..e93d05f6e 100644
--- a/psi/int.mak
+++ b/psi/int.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2019 Artifex Software, Inc.
+# Copyright (C) 2001-2018 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -1772,13 +1772,13 @@ $(PSOBJ)zform.$(OBJ) : $(PSSRC)zform.c $(OP) $(ghost_h) $(oper_h)\
# level2dict is defined.
$(PSD)pdf.dev : $(ECHOGS_XE)\
$(GLD)dps2lib.dev $(PSD)dps2read.dev\
- $(PSD)pdffonts.dev $(PSD)psl3.dev $(PSD)pdfread.dev $(PSD)cff.dev\
+ $(PSD)pdffonts.dev $(PSD)psl3.dev $(PSD)pdfread.dev\
$(PSD)fmd5.dev $(PSD)fsha2.dev $(PSD)farc4.dev $(PSD)faes.dev\
$(PSD)ttfont.dev $(PSD)type2.dev $(PSD)pdfops.dev\
$(PSD)pdf_r6.dev $(INT_MAK) $(MAKEDIRS)
$(SETMOD) $(PSD)pdf -include $(PSD)psbase $(GLD)dps2lib
$(ADDMOD) $(PSD)pdf -include $(PSD)dps2read $(PSD)pdffonts $(PSD)psl3
- $(ADDMOD) $(PSD)pdf -include $(GLD)psl2lib $(PSD)pdfread $(PSD)cff
+ $(ADDMOD) $(PSD)pdf -include $(GLD)psl2lib $(PSD)pdfread
$(ADDMOD) $(PSD)pdf -include $(PSD)fmd5 $(PSD)fsha2
$(ADDMOD) $(PSD)pdf -include $(PSD)farc4 $(PSD)faes.dev
$(ADDMOD) $(PSD)pdf -include $(PSD)ttfont $(PSD)type2
@@ -1793,13 +1793,15 @@ $(PSD)pdffonts.dev : $(ECHOGS_XE) $(INT_MAK) $(MAKEDIRS)
$(SETMOD) $(PSD)pdffonts -ps gs_mex_e gs_mro_e gs_pdf_e gs_wan_e
$(PSD)pdfread.dev : $(ECHOGS_XE) \
- $(PSD)frsd.dev $(PSD)func4.dev $(PSD)fzlib.dev $(PSD)transpar.dev\
+ $(PSD)frsd.dev $(PSD)func4.dev $(PSD)fzlib.dev $(PSD)transpar.dev $(PSD)cff.dev\
$(INT_MAK) $(MAKEDIRS)
$(SETMOD) $(PSD)pdfread -include $(PSD)frsd $(PSD)func4 $(PSD)fzlib
$(ADDMOD) $(PSD)pdfread -include $(PSD)transpar
$(ADDMOD) $(PSD)pdfread -ps pdf_ops
$(ADDMOD) $(PSD)pdfread -ps pdf_rbld
- $(ADDMOD) $(PSD)pdfread -ps pdf_base pdf_draw pdf_font pdf_main pdf_sec
+ $(ADDMOD) $(PSD)pdfread -ps pdf_base pdf_draw
+ $(ADDMOD) $(PSD)pdfread -include $(PSD)cff
+ $(ADDMOD) $(PSD)pdfread -ps pdf_font pdf_main pdf_sec
# ---------------- PS Support for Font API ---------------- #
$(PSD)fapi_ps.dev : $(LIB_MAK) $(ECHOGS_XE) $(PSOBJ)zfapi.$(OBJ)\