[gs-cvs] rev 7803 - in trunk/gs: doc lib
alexcher at ghostscript.com
alexcher at ghostscript.com
Sun Mar 25 14:58:02 PDT 2007
Author: alexcher
Date: 2007-03-25 14:58:01 -0700 (Sun, 25 Mar 2007)
New Revision: 7803
Modified:
trunk/gs/doc/Use.htm
trunk/gs/lib/pdf_font.ps
Log:
Add a new option for ignoring an Encoding entry of a True Type font dictionary.
Work around the bug 688596.
DETAILS:
This patch provides a workaround for PDF documents that include an incorrect
Encoding entry for a True Type font dictionary. Using the new command line
option -dIgnoreTTEncoding one can force the PDF interpreter to use an encoding
specified in the 'cmap' table of embedded True Type fonts. When it is
specified, the Encoding dictionary is not tested for PDF comformity.
EXPECTED DIFFERENCES :
None when the new option isn't active.
There are real regressions when the option is active: 159.pdf,
687572.pdf, adesso1.pdf, adesso3.pdf, adesso6.pdf, ADOBE1-4.pdf,
brochurep1.pdf, ccc.pdf, Jahr2000.pdf, LD.pdf, ngnews.pdf, ngnews1.pdf,
rf1025.pdf, xngnews.pdf.
Modified: trunk/gs/doc/Use.htm
===================================================================
--- trunk/gs/doc/Use.htm 2007-03-25 20:16:59 UTC (rev 7802)
+++ trunk/gs/doc/Use.htm 2007-03-25 21:58:01 UTC (rev 7803)
@@ -611,6 +611,16 @@
PDF files.
</dl>
+<dl>
+<dt><b><tt>-dIgnoreTTEncoding</tt></b>
+<dd>
+Force the PDF interpreter to use an encoding specified in the 'cmap' table
+of embedded TrueType fonts and ignore the Encoding dictionary.
+This is a last resort measure for the files that have an incorrect Encoding
+entry for a TrueType font dictionary. This option is known to cause
+regressions and should not be used routinely.
+</dl>
+
<h3><a name="PDF_problems"></a>Problems interpreting a PDF file</h3>
<p>
Modified: trunk/gs/lib/pdf_font.ps
===================================================================
--- trunk/gs/lib/pdf_font.ps 2007-03-25 20:16:59 UTC (rev 7802)
+++ trunk/gs/lib/pdf_font.ps 2007-03-25 21:58:01 UTC (rev 7803)
@@ -132,10 +132,15 @@
% Get the (possibly modified) encoding of a font.
/getfontencoding { % <font-resource> <font> getfontencoding
% <font-resource> <font> <Encoding|null>
- 1 index /Encoding known {
- dup /Encoding knownoget { 2 index getencoding } { null } ifelse
+ //systemdict /IgnoreTTEncoding .knownget not { //false } if {
+ 1 index /Subtype get /TrueType eq } { //false } ifelse {
+ //null
} {
- null
+ 1 index /Encoding known {
+ dup /Encoding knownoget { 2 index getencoding } { //null } ifelse
+ } {
+ //null
+ } ifelse
} ifelse
} bdef
More information about the gs-cvs
mailing list