Re: Patch to use FontInfo/OrigFontName from PSCRIPT driver (bug 688006) |

"Igor V. Melichev" <[email protected]> Mon, 28 Mar 2005 23:58:54 +0400
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
Ray,From a brief review, I have no objection to the patch. Please test with
comparefiles, then commit.Igor.----- Original Message ----- 
From: "Ray Johnston" <[email protected]>
To: "Gs-Code-Review" <[email protected]>
Cc: "Igor V. Melichev" <[email protected]>
Sent: Monday, March 28, 2005 10:54 PM
Subject: Patch to use FontInfo/OrigFontName from PSCRIPT driver (bug 688006) 
| xefitra


> Reviewers,
>
> The attached patch uses the font name from the FontInfo dict in the
> Font preferrentially over the 'garbled' name downloaded by PSCRIPT5.
>
> Log Message:
>
> Use the FontInfo/OrigFontName entry (if present) to get the source font
> name for fonts downloaded/embedded in PostScript created by PSCRIPT5.dll
> on Windows. This improves the names in PDF files when pdfwrite is used
> and matches the font name produced by Adobe Distiller. Bug 688006 for
> customer 32.
>
> DETAILS:
>
> Apparently Adobe Distiller picks up the OrigFontName from the FontInfo
> from a font 'downloaded' (embedded) in the PostScript created by
> PSCRIPT5.DLL. Not surprising given the tight coupling between Adobe
> and Microsoft when it comes to PSCRIPT5.DLL.
>
> Expected Differences:
>
> None.
>
> _______________________________________________________________________
>
> Regards,
> Ray
>
>


--------------------------------------------------------------------------------


> Index: src/zbfont.c
> ===================================================================
> RCS file: /cvs/ghostscript/gs/src/zbfont.c,v
> retrieving revision 1.28
> diff -c -r1.28 zbfont.c
> *** src/zbfont.c 15 Nov 2004 01:12:06 -0000 1.28
> --- src/zbfont.c 28 Mar 2005 18:41:51 -0000
> ***************
> *** 534,540 ****
>      )
>      memset(pomat, 0, sizeof(*pomat));
>      }
> !     if (dict_find_string((porigfont != NULL ? porigfont : op), ".Alias", 
> &pfontname) > 0) {
>          /* If we emulate the font, we want the requested name rather than 
> a substitute. */
>  get_font_name(mem, pfname, pfontname);
>      } else if (dict_find_string((porigfont != NULL ? porigfont : op), 
> "FontName", &pfontname) > 0) {
> --- 534,544 ----
>      )
>      memset(pomat, 0, sizeof(*pomat));
>      }
> !     /* Use the FontInfo/OrigFontName key preferrentially (created by MS 
> PSCRIPT driver) */
> !     if ((dict_find_string((porigfont != NULL ? porigfont : op), 
> "FontInfo", &pfontname) > 0) &&
> !         (dict_find_string(pfontname, "OrigFontName", &pfontname) > 0)) {
> ! get_font_name(mem, pfname, pfontname);
> !     } else if (dict_find_string((porigfont != NULL ? porigfont : op), 
> ".Alias", &pfontname) > 0) {
>          /* If we emulate the font, we want the requested name rather than 
> a substitute. */
>  get_font_name(mem, pfname, pfontname);
>      } else if (dict_find_string((porigfont != NULL ? porigfont : op), 
> "FontName", &pfontname) > 0) {
>