[gs-commits] rev 10887 - branches/gs_2_colors/Resource/Init

robin at ghostscript.com robin at ghostscript.com
Tue Mar 9 15:24:08 UTC 2010


Author: robin
Date: 2010-03-09 15:24:07 +0000 (Tue, 09 Mar 2010)
New Revision: 10887

Modified:
   branches/gs_2_colors/Resource/Init/pdf_ops.ps
Log:
Add some .swapcolors required in the Text Rendering mode procedures.
The omission of these was causing strokes/fills to come out the same
color when pdfwritten. 

Down to just 10 pdfwrite changes.



Modified: branches/gs_2_colors/Resource/Init/pdf_ops.ps
===================================================================
--- branches/gs_2_colors/Resource/Init/pdf_ops.ps	2010-03-09 14:55:48 UTC (rev 10886)
+++ branches/gs_2_colors/Resource/Init/pdf_ops.ps	2010-03-09 15:24:07 UTC (rev 10887)
@@ -746,7 +746,9 @@
 ] readonly def
 
 /pdfwrite_textrenderingprocs [
+	% Tr 0 - Fill
 	{ setfillstate show } bind
+	% Tr 1 - Stroke
 	{ setstrokestate
         % Need to set the stroke width to a value which gives the correct
         % width under pdfwrite. Pdfwrite uses (in text mode) an identity
@@ -761,7 +763,8 @@
           % we can ignore it. (wrong answer, but consistent)
           pop pop currentlinewidth
         }ifelse setlinewidth
-        show } bind
+        .swapcolors show .swapcolors } bind
+	% Tr 2 - Fill then Stroke
 	{ gsave 0 .settextrenderingmode 
 	  setfillstate dup show currentpoint 3 -1 roll 
 	  grestore gsave setstrokestate
@@ -775,12 +778,16 @@
         .swapcolors
 	  grestore moveto
 	} bind
+	% Tr 3 - Neither fill nor stroke
 	{ setfillstate show } bind
+	% Tr 4 - Fill, add to clip
 	{ gsave 0 .settextrenderingmode 
 	  setfillstate dup show grestore true charpath } bind
+	% Tr 5 - Stroke, add to clip
 	{ gsave 1 .settextrenderingmode 
-	  setstrokestate dup show grestore
+	  setstrokestate dup .swapcolors show .swapcolors grestore
 	  true charpath } bind
+	% Tr 6 - Fill, stroke, add to clip
 	{ gsave 0 .settextrenderingmode 
 	  setfillstate dup show grestore gsave dup 
 	  setstrokestate false charpath 
@@ -791,6 +798,7 @@
         .swapcolors
         stroke .swapcolors grestore 
 	  true charpath } bind
+	% Tr 7 - Add to clip
 	{ true charpath } bind
 ] readonly def
 



More information about the gs-commits mailing list