Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 311923 - app-text/ghostscript-gpl-8.71-r2 missing Courier font : breaks many packages
Summary: app-text/ghostscript-gpl-8.71-r2 missing Courier font : breaks many packages
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords:
: 313203 314195 (view as bug list)
Depends on:
Blocks: 256088
  Show dependency tree
 
Reported: 2010-03-29 13:20 UTC by Helmut Jarausch
Modified: 2010-08-13 17:01 UTC (History)
11 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Postscript file using Courier font - fails with GS-8.71-r2 (Hello.C.ps,13.83 KB, text/plain)
2010-03-31 10:39 UTC, Helmut Jarausch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2010-03-29 13:20:51 UTC
ghostscript-gpl-8.71-r2 removes 
gnu-gs-fonts-std in favor of urw-fonts
But now many packages like app-text/a2ps which generate
postscript code like
  /fCourier ISO-8859-1Encoding /Courier reencode_font
"fail"  i.e.  their output cannot be viewed by ghostscript anymore.
What's the reason for that change?!


Reproducible: Always
Comment 1 Dror Levin (RETIRED) gentoo-dev 2010-03-29 23:09:01 UTC
The change was made because of bug 247657 and is a good change. Anyway, all fonts installed by gnu-gs-fonts-std are installed by urw-fonts, it's just a newer version and no fonts should be missing.

From a quick examination I saw that the file n022003l.pfb, which is the font Nimbus Mono L, used to identify as both Nimbus Mono and Courier now doesn't identify itself as Courier anymore. The quick fix to this is to alias the fonts in fontconfig using the command eselect fontconfig enable --global 30-metric-aliases.conf (as root). Please try this and see if the problem is fixed.
Comment 2 Helmut Jarausch 2010-03-30 07:10:55 UTC
(In reply to comment #1)
> The change was made because of bug 247657 and is a good change. Anyway, all
> fonts installed by gnu-gs-fonts-std are installed by urw-fonts, it's just a
> newer version and no fonts should be missing.
> 
> From a quick examination I saw that the file n022003l.pfb, which is the font
> Nimbus Mono L, used to identify as both Nimbus Mono and Courier now doesn't
> identify itself as Courier anymore. The quick fix to this is to alias the fonts
> in fontconfig using the command eselect fontconfig enable --global
> 30-metric-aliases.conf (as root). Please try this and see if the problem is
> fixed.
> 

This eselect command doesn't work here :
!!! Error: 30-metric-aliases.conf is already installed

Next I tried to first disable and then enable it.
This works but doesn't fix the problem.
If desired I can send a small postscript file which cannot be handled
by ghostscript anymore.
Comment 3 Dror Levin (RETIRED) gentoo-dev 2010-03-30 14:50:42 UTC
(In reply to comment #2)
> If desired I can send a small postscript file which cannot be handled
> by ghostscript anymore.
> 

Yes, please attach a test case for us to check.
Comment 4 Helmut Jarausch 2010-03-31 10:39:09 UTC
Created attachment 225919 [details]
Postscript file using Courier font - fails with GS-8.71-r2

Testcase for ghostscript-8.71-r2 (8.71-r1 works just fine)
Comment 5 Dror Levin (RETIRED) gentoo-dev 2010-03-31 19:32:54 UTC
That testcase works for me. Running gs Hello.C.ps I get the following output:

GPL Ghostscript 8.71 (2010-02-10)
Copyright (C) 2010 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/8.71/Resource/Font/NimbusMonL-Regu.
Can't find (or can't open) font file NimbusMonL-Regu.
Can't find (or can't open) font file /usr/share/ghostscript/8.71/Resource/Font/NimbusMonL-Regu.
Can't find (or can't open) font file NimbusMonL-Regu.
Querying operating system for font files...
Loading NimbusMonL-Regu font from /usr/share/fonts/default/ghostscript/n022003l.pfb... 3510680 1950365 5610544 3481584 1 done.
Loading NimbusMonL-Bold font from /usr/share/fonts/urw-fonts/n022004l.pfb... 3553672 2084013 5610544 3485791 1 done.
Loading NimbusMonL-BoldObli font from /usr/share/fonts/urw-fonts/n022024l.pfb... 3592216 2205523 5610544 3489390 1 done.
Loading NimbusMonL-ReguObli font from /usr/share/fonts/urw-fonts/n022023l.pfb... 3693008 2336926 5610544 3492989 1 done.
Loading NimbusSanL-Regu font from /usr/share/fonts/urw-fonts/n019003l.pfb... 3836664 2482220 5610544 3497434 1 done.
Loading NimbusSanL-Bold font from /usr/share/fonts/urw-fonts/n019004l.pfb... 3958392 2599397 5610544 3501033 1 done.
Loading NimbusRomNo9L-Medi font from /usr/share/fonts/urw-fonts/n021004l.pfb... 4125896 2769561 5610544 3504934 1 done.
Loading NimbusRomNo9L-Regu font from /usr/share/fonts/default/ghostscript/n021003l.pfb... 4293512 2939714 5610544 3508879 1 done.
Loading StandardSymL font from /usr/share/fonts/urw-fonts/s050000l.pfb... 4354064 2996541 5610544 3513214 1 done.
>>showpage, press <return> to continue<<

And it looks fine (the same as it does in okular, for what it's worth). Try running the same in a terminal and paste your output.
Comment 6 Helmut Jarausch 2010-04-01 06:30:11 UTC
(In reply to comment #5)
> That testcase works for me. Running gs Hello.C.ps I get the following output:
> 
> GPL Ghostscript 8.71 (2010-02-10)
> Copyright (C) 2010 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/8.71/Resource/Font/NimbusMonL-Regu.
> Can't find (or can't open) font file NimbusMonL-Regu.
> Can't find (or can't open) font file
> /usr/share/ghostscript/8.71/Resource/Font/NimbusMonL-Regu.
> Can't find (or can't open) font file NimbusMonL-Regu.
> Querying operating system for font files...
> Loading NimbusMonL-Regu font from
> /usr/share/fonts/default/ghostscript/n022003l.pfb... 3510680 1950365 5610544
> 3481584 1 done.
> Loading NimbusMonL-Bold font from /usr/share/fonts/urw-fonts/n022004l.pfb...
> 3553672 2084013 5610544 3485791 1 done.
> Loading NimbusMonL-BoldObli font from
> /usr/share/fonts/urw-fonts/n022024l.pfb... 3592216 2205523 5610544 3489390 1
> done.
> Loading NimbusMonL-ReguObli font from
> /usr/share/fonts/urw-fonts/n022023l.pfb... 3693008 2336926 5610544 3492989 1
> done.
> Loading NimbusSanL-Regu font from /usr/share/fonts/urw-fonts/n019003l.pfb...
> 3836664 2482220 5610544 3497434 1 done.
> Loading NimbusSanL-Bold font from /usr/share/fonts/urw-fonts/n019004l.pfb...
> 3958392 2599397 5610544 3501033 1 done.
> Loading NimbusRomNo9L-Medi font from /usr/share/fonts/urw-fonts/n021004l.pfb...
> 4125896 2769561 5610544 3504934 1 done.
> Loading NimbusRomNo9L-Regu font from
> /usr/share/fonts/default/ghostscript/n021003l.pfb... 4293512 2939714 5610544
> 3508879 1 done.
> Loading StandardSymL font from /usr/share/fonts/urw-fonts/s050000l.pfb...
> 4354064 2996541 5610544 3513214 1 done.
> >>showpage, press <return> to continue<<
> 
> And it looks fine (the same as it does in okular, for what it's worth). Try
> running the same in a terminal and paste your output.
> 

(In reply to comment #5)
> That testcase works for me. Running gs Hello.C.ps I get the following output:
> 
> GPL Ghostscript 8.71 (2010-02-10)
> Copyright (C) 2010 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/8.71/Resource/Font/NimbusMonL-Regu.
> Can't find (or can't open) font file NimbusMonL-Regu.
> Can't find (or can't open) font file
> /usr/share/ghostscript/8.71/Resource/Font/NimbusMonL-Regu.
> Can't find (or can't open) font file NimbusMonL-Regu.
> Querying operating system for font files...
> Loading NimbusMonL-Regu font from
> /usr/share/fonts/default/ghostscript/n022003l.pfb... 3510680 1950365 5610544
> 3481584 1 done.
> Loading NimbusMonL-Bold font from /usr/share/fonts/urw-fonts/n022004l.pfb...
> 3553672 2084013 5610544 3485791 1 done.
> Loading NimbusMonL-BoldObli font from
> /usr/share/fonts/urw-fonts/n022024l.pfb... 3592216 2205523 5610544 3489390 1
> done.
> Loading NimbusMonL-ReguObli font from
> /usr/share/fonts/urw-fonts/n022023l.pfb... 3693008 2336926 5610544 3492989 1
> done.
> Loading NimbusSanL-Regu font from /usr/share/fonts/urw-fonts/n019003l.pfb...
> 3836664 2482220 5610544 3497434 1 done.
> Loading NimbusSanL-Bold font from /usr/share/fonts/urw-fonts/n019004l.pfb...
> 3958392 2599397 5610544 3501033 1 done.
> Loading NimbusRomNo9L-Medi font from /usr/share/fonts/urw-fonts/n021004l.pfb...
> 4125896 2769561 5610544 3504934 1 done.
> Loading NimbusRomNo9L-Regu font from
> /usr/share/fonts/default/ghostscript/n021003l.pfb... 4293512 2939714 5610544
> 3508879 1 done.
> Loading StandardSymL font from /usr/share/fonts/urw-fonts/s050000l.pfb...
> 4354064 2996541 5610544 3513214 1 done.
> >>showpage, press <return> to continue<<
> 
> And it looks fine (the same as it does in okular, for what it's worth). Try
> running the same in a terminal and paste your output.
> 

Strangely enough, ghostscript-8.71-r3 by itself (i.e. gs) works for that
example, BUT gv for this test file still fails:
gv -noquiet -infoAll Hello.C.ps

shows

This software comes with NO WARRANTY: see the file PUBLIC for details.
Can't find (or can't open) font file /usr/share/ghostscript/8.71/Resource/Font/NimbusMonL-Regu.
Can't find (or can't open) font file NimbusMonL-Regu.
Can't find (or can't open) font file /usr/share/ghostscript/8.71/Resource/Font/NimbusMonL-Regu.
Can't find (or can't open) font file NimbusMonL-Regu.
Querying operating system for font files...
Can't find (or can't open) font file /usr/share/ghostscript/8.71/Resource/Font/NimbusMonL-Regu.
Can't find (or can't open) font file NimbusMonL-Regu.
Didn't find this font on the system!
Unable to substitute for font.
Error: /invalidfont in /findfont
Operand stack:
   iso1dict   fCourier   --nostringval--   Courier
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1862   1   3   %oparray_pop   1861   1   3   %oparray_pop   1845   1   3   %oparray_pop   1739   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   1820   4   5   %oparray_pop
Dictionary stack:
   --dict:1159/1684(ro)(G)--   --dict:0/20(G)--   --dict:71/200(L)--   --dict:56/200(L)--   --dict:0/8(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.71: Unrecoverable error, exit code 1


So, should I make a bug report for app-text/gv-3.6.7 ?

Many thanks,
Helmut.

 
Comment 7 Helmut Jarausch 2010-04-01 07:01:49 UTC
(In reply to comment #6)
> (In reply to comment #5)
> So, should I make a bug report for app-text/gv-3.6.7 ?

It still seems to be a ghostscript bug since
not only gv but als evince (invalidfont -10) and gsview fails, as well.

Comment 8 Maik Nijhuis 2010-04-05 17:16:02 UTC
With epstopdf, from the texlive-fontutils-2009 package, I also got an error from ghostscript-gpl-8.71-r3 about an invalid font, which was Times-Roman in my case.

After downgrading urw-fonts from 2.4.9 to 2.4.6, and installing gnu-gs-fonts-std, the problem was gone. I'll mask urw-fonts-2.4.9 for now.
Comment 9 Andrey Grozin gentoo-dev 2010-04-11 08:41:24 UTC
*** Bug 314195 has been marked as a duplicate of this bug. ***
Comment 10 Andrey Grozin gentoo-dev 2010-04-11 08:44:54 UTC
*** Bug 313203 has been marked as a duplicate of this bug. ***
Comment 11 Martin von Gagern 2010-04-13 15:14:47 UTC
kpdf and kghostview from kde 3.5 (via kde-sunset overlay) affected as well: some documents simply display no text at all, and not even an error message.
Comment 12 Andrey Grozin gentoo-dev 2010-04-14 11:51:41 UTC
Cannot emerge dev-lang/nasm-2.08.01 with USE=doc:

perl ./genpsdriver.pl > nasmdoc.ps
false            -n -q --nosecurity -o nasmdoc.pdf nasmdoc.ps || \
        ps2pdf           nasmdoc.ps nasmdoc.pdf || \
        false            nasmdoc.ps -o nasmdoc.pdf
Error: /invalidfont in /findfont
Operand stack:
   Times-Italic-NASM   Times-Italic
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1862   1   3   %oparray_pop   1861   1   3   %oparray_pop   1845   1   3   %oparray_pop   1739   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   1820   2   3   %oparray_pop
Dictionary stack:
   --dict:1159/1684(ro)(G)--   --dict:0/20(G)--   --dict:91/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 3090
GPL Ghostscript 8.71: Unrecoverable error, exit code 1

It seems this ghostscript/urwfonts upgrade has broken half the tree :-(
Comment 13 Peter Volkov (RETIRED) gentoo-dev 2010-04-14 13:02:23 UTC
Yup, to many things broken. If I (or Dror) fail to find time to find time before friday to fix this issue, I'll revert everything back to the state it was. Really bad fonts in some documents is not a problem compared to inability to read any documents/build some packages...
Comment 14 Dror Levin (RETIRED) gentoo-dev 2010-04-14 19:56:24 UTC
It seems that for some reason some people don't have the /usr/share/fonts/default/ghostscript symlink, and that's what is causing the problem. So please check if the /usr/share/fonts/default dir exists for you and if it contains a symlink to the urw-fonts dir.
If you don't have them then please re-emerge ghostscript-gpl, that should create the symlink and solve the issue for you.
If you do have them but still have this issue, please report here. Also report if re-emerging doesn't create the symlink and/or doesn't solve this problem.

If this is indeed the cause of this, I'll look into why the symlink is gone for some people and how to make sure that doesn't happen (or work around this in some other way).
Comment 15 Dror Levin (RETIRED) gentoo-dev 2010-04-14 20:25:03 UTC
I also added a block on media-fonts/gnu-gs-fonts-other to urw-fonts-2.4.9 as that package installs files in /usr/share/fonts/default/ghostscript/ and prevents the installation of a symlink. Note that the fonts it installs are available in other packages (media-fonts/font-bitstream-type1 and media-fonts/font-adobe-utopia-type1, for example).
Comment 16 Cedric Godin 2010-04-14 21:36:27 UTC
On my system:
ls -ld /usr/share/fonts/default/*
-rw-r--r-- 1 root root 5070 Jun 23  2006 /usr/share/fonts/default/encodings.dir
-rw-r--r-- 1 root root   23 Jun 23  2006 /usr/share/fonts/default/fonts.cache-1
-rw-r--r-- 1 root root    2 Jun 23  2006 /usr/share/fonts/default/fonts.dir
-rw-r--r-- 1 root root    2 Jun 23  2006 /usr/share/fonts/default/fonts.scale
drwxr-xr-x 2 root root 4096 Apr 14 22:55 /usr/share/fonts/default/ghostscript

so ghostscript is not a symlink. It contains:
/usr/share/fonts/default/ghostscript:
total 36
-rw-r--r-- 1 root root  5070 Jun 23  2006 encodings.dir
-rw-r--r-- 1 root root 25850 Sep 13  2006 fonts.cache-1

And when emerge -C app-text/ghostscript-gpl it stays because of this 2 files.
If i rm -r the dir and re-emerge ghostscript:

enea ~ # cd /usr/share/fonts/default/
enea default # ll
total 20
-rw-r--r-- 1 root root 5070 Jun 23  2006 encodings.dir
-rw-r--r-- 1 root root   23 Jun 23  2006 fonts.cache-1
-rw-r--r-- 1 root root    2 Jun 23  2006 fonts.dir
-rw-r--r-- 1 root root    2 Jun 23  2006 fonts.scale
lrwxrwxrwx 1 root root   26 Apr 14 23:34 ghostscript -> /usr/share/fonts/urw-fonts

So now the symlink is there.
Comment 17 Dror Levin (RETIRED) gentoo-dev 2010-04-14 22:10:28 UTC
(In reply to comment #16)
> And when emerge -C app-text/ghostscript-gpl it stays because of this 2 files.
> If i rm -r the dir and re-emerge ghostscript:
> 
> [snip]
> 
> So now the symlink is there.
Thanks for your input.

If others report similar findings as well I'll add a check to ghostscript-gpl to fail and warn the user in case /usr/share/fonts/default/ghostscript is not a symlink.

Note: in the future please check what package owns the files in that dir before removing it, so we can investigate (see 'equery belongs' for that).
Comment 18 Cedric Godin 2010-04-14 22:26:50 UTC
(In reply to comment #17)
> Note: in the future please check what package owns the files in that dir before
> removing it, so we can investigate (see 'equery belongs' for that).
> 

Did it ;-) and that's why I rm'ed it (did'nt belong to any package)
Comment 19 Ryan Hill (RETIRED) gentoo-dev 2010-04-14 23:42:59 UTC
we should be automatically removing font directories only containing generated files.
Comment 20 Helmut Jarausch 2010-04-15 06:57:53 UTC
(In reply to comment #17)
> If others report similar findings as well I'll add a check to ghostscript-gpl
> to fail and warn the user in case /usr/share/fonts/default/ghostscript is not a
> symlink.
> 
> Note: in the future please check what package owns the files in that dir before
> removing it, so we can investigate (see 'equery belongs' for that).

I've lots of files in that directory.
They are all installed by media-fonts/gnu-gs-fonts-other except the
file fonts.cache-1 where qfile couldn't determine which package had installed
that file.



Comment 21 Martin von Gagern 2010-04-15 09:31:52 UTC
Reported bug #315425 for the fact that portage doesn't print an error message when it fails to install a symlink.

Nevertheless, a check in the ebuild as suggested by comment #17 could give better instructions about how to resolve the issue. Comment #19 sounds good as well. I'd say we'd want all these fixes.
Comment 22 Dror Levin (RETIRED) gentoo-dev 2010-04-15 12:43:51 UTC
I bumped ghostscript-gpl to r4, adding a check in pkg_setup to notify the user and die in case /usr/share/fonts/default/ghostscript exists and is not a symlink. Also, as I've said before, gnu-gs-fonts-other is now blocked by urw-fonts, so cases like this should hopefully be kept to a minimum.

Please reopen if this bug persists or if emerging r4 doesn't fix it. For other issues please file new bugs.

Thank you all for reporting, testing and helping in general. Sorry it took so long to find and fix this.
Comment 23 Martin Mokrejš 2010-04-15 16:05:07 UTC
(In reply to comment #22)
> I bumped ghostscript-gpl to r4, adding a check in pkg_setup to notify the user
> and die in case /usr/share/fonts/default/ghostscript exists and is not a
> symlink. Also, as I've said before, gnu-gs-fonts-other is now blocked by
> urw-fonts, so cases like this should hopefully be kept to a minimum.
> 

[ebuild     U ] app-text/ghostscript-gpl-8.71-r4 [8.71-r3] USE="X cairo cups gtk jpeg2k -bindist -djvu" LINGUAS="-ja -ko -zh_CN -zh_TW" 0 kB

Like in comment #16 I unmerged media-fonts/gnu-gs-fonts-other-6.0 and was left with this:

# ls -la /usr/share/fonts/default/ghostscript
total 40
drwxr-xr-x 2 root root  4096 Apr 15 16:03 .
drwxr-xr-x 3 root root  4096 Feb 11  2006 ..
-rw-r--r-- 1 root root  3965 Feb 11  2006 encodings.dir
-rw-r--r-- 1 root root 25850 Mar 30  2006 fonts.cache-1
#

I just removed the directory and got through with -r4 upgrade.
Comment 24 bungernut 2010-08-13 17:01:40 UTC
There are a few things about this bug that don't make sense to me. I currently have a problem with Ghostscript "Error: /invalidfont in /findfont", but I do not have urw-fonts even though I have very recently updated world and remerged ghostscript-gpl. The directory /usr/share/fonts/default does not even exist on my machine so symlinks are out of the question... Certanly the re-emerge did not create any such directory w/ symlink.

The error as Octave reports it:

octave:2> print('testprint','-dpdf')
error: print: Conversion failed, /tmp/oct-o2SeWP.ps -> testprint.pdf.
Error was:
Error: /invalidfont in /findfont
Operand stack:
   Symbol-Oblique   Symbol
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_pop   1861   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1836   2   4   %oparray_pop
Dictionary stack:
   --dict:1158/1684(ro)(G)--   --dict:0/20(G)--   --dict:71/200(L)--   --dict:169/256(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 14964
GPL Ghostscript 8.71: Unrecoverable error, exit code 1