[gs-cvs] rev 7815 - trunk/gs/src

leonardo at ghostscript.com leonardo at ghostscript.com
Sun Apr 1 14:46:50 PDT 2007


Author: leonardo
Date: 2007-04-01 14:46:50 -0700 (Sun, 01 Apr 2007)
New Revision: 7815

Modified:
   trunk/gs/src/gdevpdtc.c
Log:
Fix (pdfwrite) : a composite font with a Type 3 descendent and FMapType 2 

DETAILS :

Patch from SaGS with minor improvements.
Bug 688639 " pdfwrite: a composite font with a Type 3 descendent and FMapType 2".
See comment #13 in the bug report.

EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/src/gdevpdtc.c
===================================================================
--- trunk/gs/src/gdevpdtc.c	2007-04-01 19:14:49 UTC (rev 7814)
+++ trunk/gs/src/gdevpdtc.c	2007-04-01 21:46:50 UTC (rev 7815)
@@ -135,11 +135,23 @@
 	    out.text.space.s_char = space_char;
 
 	    gs_matrix_multiply(&prev_font->FontMatrix, psmat, &fmat);
+	    out.index = 0; /* Note : we don't reset out.xy_index here. */
 	    code = pdf_process_string_aux(&out, &str, NULL, &fmat, &text_state);
 	    if (code < 0)
 		return code;
 	    curr.xy_index = out.xy_index; /* pdf_encode_process_string advanced it. */
-	    gs_text_enum_copy_dynamic(pte, (gs_text_enum_t *)&prev, true);
+	    pte->xy_index = out.xy_index;
+	    if (out.index < str.size) {
+		gs_glyph glyph;
+
+		/* Advance *pte exactly for out.index chars, 
+		   because above we stored bytes into buf. */
+		while (out.index--)
+		    pte->orig_font->procs.next_char_glyph(pte, &chr, &glyph);
+		font_code = 2; /* force exiting the loop */
+	    } else
+		/* advance *pte past the current substring */
+		gs_text_enum_copy_dynamic(pte, (gs_text_enum_t *)&prev, true);
 	    if (return_width) {
 		pte->returned.total_width.x = total_width.x +=
 		    out.returned.total_width.x;



More information about the gs-cvs mailing list