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

ken at ghostscript.com ken at ghostscript.com
Wed Jan 2 05:11:00 PST 2008


Author: ken
Date: 2008-01-02 05:10:59 -0800 (Wed, 02 Jan 2008)
New Revision: 8474

Modified:
   trunk/gs/src/gdevpdtb.c
   trunk/gs/src/gdevpdtb.h
   trunk/gs/src/gdevpdtd.c
   trunk/gs/src/gdevpdtf.c
   trunk/gs/src/gdevpdtf.h
Log:
Fix (pdfwrite): Tidy up after the prior patch, 
algorithmically this is the same as before.

Details:
Bug #689597 "PDF created with NoEmbed has wrong BaseFont name".

gdevpdtb.c, gdevpdtf.c, gdevpdtf.h, remove the redundant
routine pdf_choose_font_name.

gdevpdtb.c, gdevpdtd.c, gdevpdtf.c, gdevpdtb.h, modify the
function pdf_base_font_alloc to remove the redundant
argument 'orig_name', we always use the original font name
now.

EXPECTED DIFFERENCES:
None.


Modified: trunk/gs/src/gdevpdtb.c
===================================================================
--- trunk/gs/src/gdevpdtb.c	2008-01-01 20:44:52 UTC (rev 8473)
+++ trunk/gs/src/gdevpdtb.c	2008-01-02 13:10:59 UTC (rev 8474)
@@ -121,7 +121,7 @@
 int
 pdf_base_font_alloc(gx_device_pdf *pdev, pdf_base_font_t **ppbfont,
 		    gs_font_base *font, const gs_matrix *orig_matrix, 
-		    bool is_standard, bool orig_name)
+		    bool is_standard)
 {
     gs_memory_t *mem = pdev->pdf_memory;
     gs_font *copied;
@@ -129,7 +129,7 @@
     pdf_base_font_t *pbfont =
 	gs_alloc_struct(mem, pdf_base_font_t,
 			&st_pdf_base_font, "pdf_base_font_alloc");
-    const gs_font_name *pfname = pdf_choose_font_name((gs_font *)font, orig_name);
+    const gs_font_name *pfname = &font->font_name;
     gs_const_string font_name;
     char fnbuf[3 + sizeof(long) / 3 + 1]; /* .F#######\0 */
     int code;

Modified: trunk/gs/src/gdevpdtb.h
===================================================================
--- trunk/gs/src/gdevpdtb.h	2008-01-01 20:44:52 UTC (rev 8473)
+++ trunk/gs/src/gdevpdtb.h	2008-01-02 13:10:59 UTC (rev 8474)
@@ -72,7 +72,7 @@
  */
 int pdf_base_font_alloc(gx_device_pdf *pdev, pdf_base_font_t **ppbfont,
 		    gs_font_base *font, const gs_matrix *orig_matrix, 
-		    bool is_standard, bool orig_name);
+		    bool is_standard);
 
 /*
  * Return a reference to the name of a base font.  This name is guaranteed

Modified: trunk/gs/src/gdevpdtd.c
===================================================================
--- trunk/gs/src/gdevpdtd.c	2008-01-01 20:44:52 UTC (rev 8473)
+++ trunk/gs/src/gdevpdtd.c	2008-01-02 13:10:59 UTC (rev 8474)
@@ -216,7 +216,7 @@
     pdf_base_font_t *pbfont;
     int code = pdf_base_font_alloc(pdev, &pbfont, font, 
 		(font->orig_FontMatrix.xx == 0 && font->orig_FontMatrix.xy == 0 
-		    ? &font->FontMatrix : &font->orig_FontMatrix), false, false);
+		    ? &font->FontMatrix : &font->orig_FontMatrix), false);
 
     if (code < 0)
 	return code;

Modified: trunk/gs/src/gdevpdtf.c
===================================================================
--- trunk/gs/src/gdevpdtf.c	2008-01-01 20:44:52 UTC (rev 8473)
+++ trunk/gs/src/gdevpdtf.c	2008-01-02 13:10:59 UTC (rev 8474)
@@ -652,19 +652,11 @@
     return false;
 }
 
-/*
- * Choose a name for embedded font.
- */
-const gs_font_name *pdf_choose_font_name(gs_font *font, bool key_name)
-{
-    return key_name ? (font->key_name.size != 0 ? &font->key_name : &font->font_name)
-	             : (font->font_name.size != 0 ? &font->font_name : &font->key_name);
-}
 pdf_font_embed_t
 pdf_font_embed_status(gx_device_pdf *pdev, gs_font *font, int *pindex,
 		      pdf_char_glyph_pair_t *pairs, int num_glyphs)
 {
-    const gs_font_name *fn = pdf_choose_font_name(font, false);
+    const gs_font_name *fn = &font->font_name;
     const byte *chars = fn->chars;
     uint size = fn->size;
     int index = pdf_find_standard_font_name(chars, size);
@@ -848,7 +840,7 @@
     gs_matrix *orig_matrix = (is_original ? &pfont->FontMatrix : &psf->orig_matrix);
 
     if (code < 0 ||
-	(code = pdf_base_font_alloc(pdev, &pdfont->base_font, pfont, orig_matrix, true, true)) < 0
+	(code = pdf_base_font_alloc(pdev, &pdfont->base_font, pfont, orig_matrix, true)) < 0
 	)
 	return code;
     pdfont->BaseFont.data = (byte *)psfi->fname; /* break const */

Modified: trunk/gs/src/gdevpdtf.h
===================================================================
--- trunk/gs/src/gdevpdtf.h	2008-01-01 20:44:52 UTC (rev 8473)
+++ trunk/gs/src/gdevpdtf.h	2008-01-02 13:10:59 UTC (rev 8474)
@@ -429,11 +429,6 @@
 int pdf_close_text_document(gx_device_pdf *pdev); /* in gdevpdtw.c */
 
 /*
- * Choose a name for embedded font.
- */
-const gs_font_name *pdf_choose_font_name(gs_font *font, bool key_name);
-
-/*
  * Convert True Type fonts into CID fonts for PDF/A.
  */
 int pdf_convert_truetype_font(gx_device_pdf *pdev,  pdf_resource_t *pres);



More information about the gs-cvs mailing list