[gs-cvs] gs/src

Igor Melichev igor at casper.ghostscript.com
Wed Jul 31 02:23:34 PDT 2002


Update of /cvs/ghostscript/gs/src
In directory casper:/tmp/cvs-serv24252/gs/src

Modified Files:
	gdevpdff.c 
Log Message:
Fix: (pdfwrite) Standard font names were erroneously suffixed.
Source Forge bug "[ 557024 ] (pdfwrite) Font display incorrect"
This changes old pdfwrite only. The new one was patched separately.


Index: gdevpdff.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpdff.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- gdevpdff.c	9 Jun 2002 23:08:22 -0000	1.30
+++ gdevpdff.c	31 Jul 2002 09:23:32 -0000	1.31
@@ -303,7 +303,10 @@
 	    return FONT_EMBED_STANDARD;
     }
     /* Check the Embed lists. */
-    if (!embed_list_includes(&pdev->params.NeverEmbed, chars, size)) {
+    if (!embed_list_includes(&pdev->params.NeverEmbed, chars, size) ||
+	(index >= 0 && !embed_as_standard(pdev, font, index, psame))
+	/* Ignore NeverEmbed for a non-standard font with a standard name */
+	) {
 	if (pdev->params.EmbedAllFonts || font_is_symbolic(font) ||
 	    embed_list_includes(&pdev->params.AlwaysEmbed, chars, size))
 	    return FONT_EMBED_YES;
@@ -797,7 +800,7 @@
 		  (ulong)pfd, pdf_resource_id((pdf_resource_t *)pfd));
 	ppf->FontDescriptor = pfd;
     } else {
-	int name_index = index;
+	int name_index = (!same ? -1 : index);
 
 	fdesc.rid = base_font->id;
 	fdesc.chars_count = pdf_font_chars_count(base_font);
@@ -810,7 +813,7 @@
 		  "[_]created pdf_font_t 0x%lx, id %ld, FontDescriptor 0x%lx, id %ld (new)\n",
 		  (ulong)ppf, pdf_resource_id((pdf_resource_t *)ppf),
 		  (ulong)pfd, pdf_resource_id((pdf_resource_t *)pfd));
-	if (index < 0) {
+	if (name_index < 0) {
 	    int ignore_same;
 	    const gs_font_name *pfname = &base_font->font_name;
 
@@ -978,6 +981,8 @@
 		size = i + 1;
 	    }
 	    code = size != pfd->FontName.size;
+	    if (!code)
+		j = NUM_RESOURCE_CHAINS;
 	}
 	/*
 	 * Non-standard fonts with standard names must always use a suffix
@@ -1000,7 +1005,7 @@
 			goto found; /* do a double 'break' */
 		}
     found:			/* only used for double 'break' above */
-	if (j < NUM_RESOURCE_CHAINS) {
+	if (j < NUM_RESOURCE_CHAINS || !code) {
 	    /* Create a unique name. */
 	    char suffix[sizeof(long) * 2 + 2];
 	    uint suffix_size;




More information about the gs-cvs mailing list