[gs-cvs] rev 8742 - trunk/gs/lib

alexcher at ghostscript.com alexcher at ghostscript.com
Fri May 16 05:48:25 PDT 2008


Author: alexcher
Date: 2008-05-16 05:48:24 -0700 (Fri, 16 May 2008)
New Revision: 8742

Modified:
   trunk/gs/lib/pdf_base.ps
   trunk/gs/lib/pdf_font.ps
Log:
Use PDFScanRules to scan ToUnicode CMap. Fix a case where CMap stream has
a name starting with 2 slashes that should not be parsed as an immediately
evaluated name. Bug 689642, customer 870.

DIFFERENCES:
None.


Modified: trunk/gs/lib/pdf_base.ps
===================================================================
--- trunk/gs/lib/pdf_base.ps	2008-05-16 00:05:42 UTC (rev 8741)
+++ trunk/gs/lib/pdf_base.ps	2008-05-16 12:48:24 UTC (rev 8742)
@@ -228,8 +228,6 @@
   { store { stop } if } aload pop .packtomark cvx
   /PDFsource 3 -1 roll store exec
 } bind def
-currentdict /PDFScanRules_true undef
-currentdict /PDFScanRules_null undef
 
 % Execute a file, like .pdfrun, for a marking context.
 % This temporarily rebinds LocalResources and DefaultQstate.

Modified: trunk/gs/lib/pdf_font.ps
===================================================================
--- trunk/gs/lib/pdf_font.ps	2008-05-16 00:05:42 UTC (rev 8741)
+++ trunk/gs/lib/pdf_font.ps	2008-05-16 12:48:24 UTC (rev 8742)
@@ -471,9 +471,16 @@
         (   **** Warning: Ignoring bad ToUnicode CMap.\n)  pdfformaterror
         pop
       } {
-        PDFfile fileposition exch
-        false resolvestream
 
+        /PDFScanRules .getuserparam dup //null eq {
+          pop //PDFScanRules_null
+        } {
+          1 dict dup /PDFScanRules 4 -1 roll put
+        } ifelse
+        //PDFScanRules_true setuserparams
+        PDFfile fileposition 3 -1 roll
+
+        //false resolvestream
         //ToUnicodeCMapReader begin
            % Following Acrobat we ignore everything outside begincmap..endcmap.
            dup 0 (begincmap) /SubFileDecode filter flushfile
@@ -484,6 +491,8 @@
         end end end
 
         PDFfile exch setfileposition
+        setuserparams
+
         1 index /FontInfo .knownget not {
           1 index /FontInfo 5 dict dup 4 1 roll put
         } if
@@ -495,7 +504,7 @@
         exch pop exch                        % font-res font-dict g2u encoding|null
         userdict /.lastToUnicode get         % font-res font-dict g2u Encoding|null CMap
         .convert_ToUnicode-into-g2u          % font-res font-dict
-        null                                 % font-res font-dict null
+        //null                               % font-res font-dict null
       } ifelse
     } if
     PDFDEBUG {



More information about the gs-cvs mailing list