Bug 698784 - Init/Fontmap.GS: Wrong alias for Helvetica-Narrow-Bold-Oblique
Summary: Init/Fontmap.GS: Wrong alias for Helvetica-Narrow-Bold-Oblique
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: 9.22
Hardware: PC Linux
: P4 major
Assignee: Chris Liddell (chrisl)
URL: https://bugzilla.redhat.com/show_bug....
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-27 07:50 UTC by David Kaspar // Dee'Kej
Modified: 2017-12-01 09:35 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
reproducer file (10.37 KB, image/x-eps)
2017-11-27 07:50 UTC, David Kaspar // Dee'Kej
Details
patch file (1.55 KB, patch)
2017-11-27 07:52 UTC, David Kaspar // Dee'Kej
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kaspar // Dee'Kej 2017-11-27 07:50:59 UTC
Created attachment 14495 [details]
reproducer file

Hello guys,

we have noted a problem with Ghotstscript's Fontmap.GS file (from Resource/Init/ folder).

This problem probably occurs only when the Fonts are not located in default font path (/usr/share/ghostscript/Resource/Font), and they are located in other system folder (/usr/share/fonts/urw-bas35/ in Fedora).

Here's the reproducer:
----------------------

[dkaspar@localhost ~]$ gs --help
GPL Ghostscript 9.22 (2017-10-04)
Copyright (C) 2017 Artifex Software, Inc.  All rights reserved.
Usage: gs [switches] [file1.ps file2.ps ...]
Most frequently used switches: (you can use # in place of =)
 -dNOPAUSE           no pause after page   | -q       `quiet', fewer messages
 -g<width>x<height>  page size in pixels   | -r<res>  pixels/inch resolution
 -sDEVICE=<devname>  select device         | -dBATCH  exit after last file
 -sOutputFile=<file> select output file: - for stdout, |command for pipe,
                                         embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PostScriptLevel3 PDF
Default output device: x11alpha
Available devices:
 <skipped>
Search path:
   /usr/share/ghostscript/9.22/Resource/Init :
   /usr/share/ghostscript/9.22/lib :
   /usr/share/ghostscript/9.22/Resource/Font :
>  /usr/share/ghostscript/fonts : /usr/share/fonts/urw-base35/ :
   /usr/share/fonts/ : /usr/share/ghostscript/conf.d :
   /usr/share/poppler/cMap/Adobe-CNS1 : /usr/share/poppler/cMap/Adobe-GB1 :
   /usr/share/poppler/cMap/Adobe-Japan1 :
   /usr/share/poppler/cMap/Adobe-Japan2 :
   /usr/share/poppler/cMap/Adobe-Korea1 :
   /usr/share/poppler/cMap/Identity-H :
   /usr/share/poppler/cMap/Identity-UTF16-H :
   /usr/share/poppler/cMap/Identity-V
Ghostscript is also using fontconfig to search for font files
For more information, see /usr/share/ghostscript/9.22/doc/Use.htm.
Please report bugs to bugs.ghostscript.com.

> [dkaspar@localhost ~]$ gs c1.eps 
GPL Ghostscript 9.22 (2017-10-04)
Copyright (C) 2017 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusRoman-Bold.
Can't find (or can't open) font file NimbusRoman-Bold.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusRoman-Bold.
Can't find (or can't open) font file NimbusRoman-Bold.
Querying operating system for font files...
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusRoman-Bold.
Can't find (or can't open) font file NimbusRoman-Bold.
Loading NimbusRoman-Bold font from /usr/share/fonts/urw-base35/NimbusRoman-Bold.t1... 4351624 2957941 6498556 5137419 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusRoman-Italic.
Can't find (or can't open) font file NimbusRoman-Italic.
Loading NimbusRoman-Italic font from /usr/share/fonts/urw-base35/NimbusRoman-Italic.t1... 4559136 3194223 6498556 5145110 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusRoman-BoldItalic.
Can't find (or can't open) font file NimbusRoman-BoldItalic.
Loading NimbusRoman-BoldItalic font from /usr/share/fonts/urw-base35/NimbusRoman-BoldItalic.t1... 4786848 3430203 6518756 5155771 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusSans-Regular.
Can't find (or can't open) font file NimbusSans-Regular.
Loading NimbusSans-Regular font from /usr/share/fonts/urw-base35/NimbusSans-Regular.t1... 4994360 3626447 6518756 5162981 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusSans-Italic.
Can't find (or can't open) font file NimbusSans-Italic.
Loading NimbusSans-Italic font from /usr/share/fonts/urw-base35/NimbusSans-Italic.t1... 5181672 3824619 6538956 5173842 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusSans-Bold.
Can't find (or can't open) font file NimbusSans-Bold.
Loading NimbusSans-Bold font from /usr/share/fonts/urw-base35/NimbusSans-Bold.t1... 5389184 4024609 6538956 5181048 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusSans-BoldItalic.
Can't find (or can't open) font file NimbusSans-BoldItalic.
Loading NimbusSans-BoldItalic font from /usr/share/fonts/urw-base35/NimbusSans-BoldItalic.t1... 5596696 4228423 6559156 5191823 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusMonoPS-Regular.
Can't find (or can't open) font file NimbusMonoPS-Regular.
Loading NimbusMonoPS-Regular font from /usr/share/fonts/urw-base35/NimbusMonoPS-Regular.t1... 5844608 4467630 6559156 5199051 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusMonoPS-Italic.
Can't find (or can't open) font file NimbusMonoPS-Italic.
Loading NimbusMonoPS-Italic font from /usr/share/fonts/urw-base35/NimbusMonoPS-Italic.t1... 6092520 4709088 6579356 5209812 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusMonoPS-Bold.
Can't find (or can't open) font file NimbusMonoPS-Bold.
Loading NimbusMonoPS-Bold font from /usr/share/fonts/urw-base35/NimbusMonoPS-Bold.t1... 6340432 4963863 6579356 5217186 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusMonoPS-BoldItalic.
Can't find (or can't open) font file NimbusMonoPS-BoldItalic.
Loading NimbusMonoPS-BoldItalic font from /usr/share/fonts/urw-base35/NimbusMonoPS-BoldItalic.t1... 6608544 5219863 6599556 5227853 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusRoman-Regular.
Can't find (or can't open) font file NimbusRoman-Regular.
Loading NimbusRoman-Regular font from /usr/share/fonts/urw-base35/NimbusRoman-Regular.t1... 6836256 5448835 6599556 5235075 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/URWGothic-Book.
Can't find (or can't open) font file URWGothic-Book.
Loading URWGothic-Book font from /usr/share/fonts/urw-base35/URWGothic-Book.t1... 7023568 5638392 6619756 5245709 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/URWGothic-BookOblique.
Can't find (or can't open) font file URWGothic-BookOblique.
Loading URWGothic-BookOblique font from /usr/share/fonts/urw-base35/URWGothic-BookOblique.t1... 7210880 5829203 6619756 5252933 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/URWGothic-Demi.
Can't find (or can't open) font file URWGothic-Demi.
Loading URWGothic-Demi font from /usr/share/fonts/urw-base35/URWGothic-Demi.t1... 7418392 6024951 6639956 5263973 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/URWGothic-DemiOblique.
Can't find (or can't open) font file URWGothic-DemiOblique.
Loading URWGothic-DemiOblique font from /usr/share/fonts/urw-base35/URWGothic-DemiOblique.t1... 7605704 6218444 6639956 5271197 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/URWBookman-Demi.
Can't find (or can't open) font file URWBookman-Demi.
Loading URWBookman-Demi font from /usr/share/fonts/urw-base35/URWBookman-Demi.t1... 7853616 6454465 6660156 5281835 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/URWBookman-DemiItalic.
Can't find (or can't open) font file URWBookman-DemiItalic.
Loading URWBookman-DemiItalic font from /usr/share/fonts/urw-base35/URWBookman-DemiItalic.t1... 8101528 6695597 6660156 5289060 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/URWBookman-Light.
Can't find (or can't open) font file URWBookman-Light.
Loading URWBookman-Light font from /usr/share/fonts/urw-base35/URWBookman-Light.t1... 8329240 6928639 6680356 5299702 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/URWBookman-LightItalic.
Can't find (or can't open) font file URWBookman-LightItalic.
Loading URWBookman-LightItalic font from /usr/share/fonts/urw-base35/URWBookman-LightItalic.t1... 8577152 7170322 6680356 5306931 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusSansNarrow-Regular.
Can't find (or can't open) font file NimbusSansNarrow-Regular.
Loading NimbusSansNarrow-Regular font from /usr/share/fonts/urw-base35/NimbusSansNarrow-Regular.t1... 8764464 7363487 6700556 5317599 2 done.
Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusSansNarrow-Bold.
Can't find (or can't open) font file NimbusSansNarrow-Bold.
Loading NimbusSansNarrow-Bold font from /usr/share/fonts/urw-base35/NimbusSansNarrow-Bold.t1... 8971976 7561925 6700556 5324949 2 done.
> Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusSansNarrow-BdOblique.
> Can't find (or can't open) font file NimbusSansNarrow-BdOblique.
> Can't find (or can't open) font file /usr/share/ghostscript/9.22/Resource/Font/NimbusSansNarrow-BdOblique.
> Can't find (or can't open) font file NimbusSansNarrow-BdOblique.
> Didn't find this font on the system!
> Unable to substitute for font.
> Error: /invalidfont in /findfont
Operand stack:
   --nostringval--   Helvetica-Narrow-BoldOblique
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   2015   1   3   %oparray_pop   2014   1   3   %oparray_pop   --nostringval--   1998   1   3   %oparray_pop   1884   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   1967   2   4   %oparray_pop
Dictionary stack:
   --dict:982/1684(ro)(G)--   --dict:0/20(G)--   --dict:82/200(L)--   --dict:67/80(L)--
Current allocation mode is local
Last OS error: Not a directory
Current file position is 6201
GPL Ghostscript 9.22: Unrecoverable error, exit code 1

-------
> NOTE: Important parts are highlighted like this.
-------

I have noted that the problem is (most likely) in Resource/Init/Fontmap.GS file. There's remap of Helvetica-Narrow-Bold-Oblique to NimbusSansNarrow-BdOblique:

-----------
% Aliases

<skipped>
> /Helvetica-Narrow-BoldOblique	/NimbusSansNarrow-BdOblique        ;

-----------

However, if you look at the contents of NimbusSansNarrowBdOblique, it contains:

> /FontName /NimbusSansNarrow-BoldOblique def

===========

So, to conclude - the filename does not correspond to /FontName inside the T1 font itself.

After patching the Fontmap.GS, the font can be found and the *.eps file is displayed correctly.

I'm attaching both the reproducer & patch.

My suggestion is to fix the Fontmap.GS (unless it breaks something for vanilla-build usage of Ghostscript), and requesting the that (URW)++ company renames the NimbusSansNarrow-BdOblique to NimbusSansNarrow-BoldOblique, so the value of /Fontname corresponds to filename.
Comment 1 David Kaspar // Dee'Kej 2017-11-27 07:52:04 UTC
Created attachment 14496 [details]
patch file
Comment 2 Chris Liddell (chrisl) 2017-12-01 09:35:36 UTC
Applied in:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=efc24229b0ba

With the addition of changing the font file name, so it is consistent.