summaryrefslogtreecommitdiff
path: root/gs
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2005-09-23 18:21:23 +0000
committerRay Johnston <ray.johnston@artifex.com>2005-09-23 18:21:23 +0000
commit2d171f2fea5a5ec7674696a681ac03ffbc7bbb3a (patch)
treed3e29ff55e964b677f38c53475165689684ef948 /gs
parent90d2dcff00ffc9cc6e1d67ec24236efe41928743 (diff)
Change reporting of some noisy (irritating) Warnings generated from many
PDF files that don't strictly follow the spec. Bug 688229. DETAILS: The "fonts with Subtype = /TrueType" and "Embedded font uses undefined proc" messages could occur MANY times in PDF files. I'm sure users will get the point as well with this approach that only gives the warnings once at the end of processing, with the list of offensive printed once. Particularly for the TrueType font issue it might make it easier to figure out which fonts are missing (and thus substituted) since each font is only listed once and the list is sorted (which will collect font families together). EXPTECTED DIFFERENCES. None (execpt the gs-stderr log will now be shorter). git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@6126 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs')
-rw-r--r--gs/lib/pdf_font.ps8
-rw-r--r--gs/lib/pdf_main.ps25
2 files changed, 29 insertions, 4 deletions
diff --git a/gs/lib/pdf_font.ps b/gs/lib/pdf_font.ps
index 7b13115fb..7e766c9ac 100644
--- a/gs/lib/pdf_font.ps
+++ b/gs/lib/pdf_font.ps
@@ -675,8 +675,8 @@ setglobal
} bdef
/undef_proc_warning {
- ( **** Embedded font uses undefined procedure ) pdfformaterror
- .namestring pdfformaterror (\n) pdfformaterror
+ /Repaired true store % flag that we have warnings
+ UndefProcList exch 2 copy .knownget { 1 add } { 1 } ifelse put
} bdef
/-| { string currentfile exch readstring pop /-| undef_proc_warning } executeonly bdef
@@ -958,8 +958,8 @@ readonly def
/buildTrueType { % <TrueType-font-resource> buildTrueType <font>
dup /BaseFont oget
- ( **** Warning: Fonts with Subtype = /TrueType should be embedded.\n) pdfformaterror
- ( But ) pdfformaterror dup =string cvs pdfformaterror ( is not embedded.\n) pdfformaterror
+ /Repaired true store % flag that we had warnings
+ TTFWarnList 1 index true put % Add fontname to the list
dup TTfonts exch .knownget {
QUIET not {
(Substituting font ) print dup =only
diff --git a/gs/lib/pdf_main.ps b/gs/lib/pdf_main.ps
index 22cdac522..ba1051ff6 100644
--- a/gs/lib/pdf_main.ps
+++ b/gs/lib/pdf_main.ps
@@ -515,6 +515,9 @@ pdfdict begin
cvlit /PDFfile exch def
/PDFsource PDFfile def
/Repaired false def
+ currentglobal true .setglobal globaldict begin
+ /TTFWarnList 0 dict def /UndefProcList 0 dict def
+ end .setglobal
PDFfile dup 0 setfileposition pdfstring readstring
not {/pdfopen cvx /syntaxerror signalerror} if
(%PDF-) search not {/pdfopen cvx /syntaxerror signalerror} if
@@ -695,7 +698,29 @@ pdfdict begin
( <<<<\n) stderrprint
} ifelse
} bind def
+% The TTFWarnList is the list of all TrueType fonts that were not embedded.
+% The UndefProcList collects noisy warnings.
+% This gets rid of many multiple warnings from pdf_font.ps
+/printCollectedWarnings {
+ TTFWarnList length 0 gt {
+ (\n **** Warning: Fonts with Subtype = /TrueType should be embedded.\n)
+ stderrprint
+ ( The following fonts were not embedded:\n)
+ stderrprint
+ [ TTFWarnList { pop .namestring (\t\t\t) exch concatstrings (\n) concatstrings } forall ]
+ { lt } .sort { stderrprint } forall
+ } if
+ UndefProcList length 0 gt {
+ (\n **** Embedded font uses undefined procedure\(s\): ) stderrprint
+ UndefProcList {
+ exch .namestring stderrprint ( ) stderrprint
+ =string cvs stderrprint ( times, ) stderrprint
+ } forall
+ (\n) stderrprint
+ } if
+} bind def
/printrepaired {
+ printCollectedWarnings
(\n **** This file had errors that were repaired or ignored.\n)
stderrprint
printProducer