Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"/usr/lib/cups/filter/foomatic-rip failed" due to GS font error

33 views
Skip to first unread message

Martijn Dekker

unread,
Mar 3, 2009, 1:46:42 PM3/3/09
to
I'm trying to get a HP OfficeJet Pro L7780 All-in-one to print from
CUPS on Slackware 12.2. The device is connected over a cabled
Ethernet network. I've configured the printer directly in CUPS,
apparently successfully, with the AppSocket/HP JetDirect protocol.
I've used the PPD file:
/usr/share/cups/model/HP/hp-officejet_pro_l7700-hpijs.ppd.gz

The problem is, sometimes printing works, sometimes it doesn't. The
command

echo test | lpr -P OfficeJet

works. Printing a Google map from Mozilla SeaMonkey works. But the test
page from CUPS itself fails. Printing from OpenOffice.org also fails,
even for simple documents.

When printing fails, the error message
"/usr/lib/cups/filter/foomatic-rip failed"
is displayed in the printer status in the CUPS web interface. The print
job is stopped and stays in the queue. So it seems it never even makes
it to the printer, as Foomatic is failing.

So I turned on CUPS debugging by setting the LogLevel option to
"debug". Below I have pasted the relevant bit out of the large debug
log produced when I try to restart the job. The culprit seems to be an
error from Ghostscript:

D [03/Mar/2009:19:36:35 +0100] [Job 63816] Error: /invalidfont in /findfont

So it can't find a font it needs. But I have no idea where that font
would be or how I would get it. The ghostscript-fonts-std package is
installed as normal.

Any hints/ideas/solutions appreciated.

- Martijn

D [03/Mar/2009:19:36:35 +0100] [Job 63816] renderer PID kid4=28048
D [03/Mar/2009:19:36:35 +0100] [Job 63816] renderer command: gs -q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=ijs -sIjsServer=hpijs -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="Officejet Pro K550" -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -dDuplex=false -r300 -sIjsParams=Quality:Quality=4,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2,PS:MediaPosition=7 -dIjsUseOutputFD -sOutputFile=- -
D [03/Mar/2009:19:36:35 +0100] [Job 63816] foomatic-gswrapper: gs '-sstdout=%stderr' '-dBATCH' '-dPARANOIDSAFER' '-dQUIET' '-dNOPAUSE' '-sDEVICE=ijs' '-sIjsServer=hpijs' '-sDeviceManufacturer=HEWLETT-PACKARD' '-sDeviceModel=Officejet Pro K550' '-dDEVICEWIDTHPOINTS=595' '-dDEVICEHEIGHTPOINTS=842' '-dDuplex=false' '-r300' '-sIjsParams=Quality:Quality=4,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2,PS:MediaPosition=7' '-dIjsUseOutputFD' '-sOutputFile=%stdout' '-_'
D [03/Mar/2009:19:36:35 +0100] [Job 63816] Error: /invalidfont in /findfont
D [03/Mar/2009:19:36:35 +0100] [Job 63816] Operand stack:
D [03/Mar/2009:19:36:35 +0100] [Job 63816] Times-Bold-iso1252 --nostringval-- Times-Bold Times-Bold
D [03/Mar/2009:19:36:35 +0100] [Job 63816] Execution stack:
D [03/Mar/2009:19:36:35 +0100] [Job 63816] %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1905 1 3 %oparray_pop 1904 1 3 %oparray_pop 1888 1 3 %oparray_pop 1771 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 1863 4 3 %oparray_pop
D [03/Mar/2009:19:36:35 +0100] [Job 63816] Dictionary stack:
D [03/Mar/2009:19:36:35 +0100] [Job 63816] --dict:1158/1684(ro)(G)-- --dict:0/20(G)-- --dict:87/200(L)--
D [03/Mar/2009:19:36:35 +0100] [Job 63816] Current allocation mode is local
D [03/Mar/2009:19:36:35 +0100] [Job 63816] Last OS error: 2
D [03/Mar/2009:19:36:35 +0100] [Job 63816] GPL Ghostscript 8.63: Unrecoverable error, exit code 1

Martijn Dekker

unread,
Mar 9, 2009, 12:29:44 PM3/9/09
to

Op 03-03-2009 schreef Martijn Dekker <mar...@inlv.demon.nl>:

> When printing fails, the error message
> "/usr/lib/cups/filter/foomatic-rip failed"
> is displayed in the printer status in the CUPS web interface. The
> print job is stopped and stays in the queue. So it seems it never
> even makes it to the printer, as Foomatic is failing.
>
> So I turned on CUPS debugging by setting the LogLevel option to
> "debug". Below I have pasted the relevant bit out of the large debug
> log produced when I try to restart the job. The culprit seems to be an
> error from Ghostscript:
>
> D [03/Mar/2009:19:36:35 +0100] [Job 63816] Error: /invalidfont
> in /findfont

I have now localized this to being the same problem as the one I had
with xpdf earlier, which also uses Ghostscript. The problem is that
Ghostscript cannot find certain standard fonts, such as Times. So when
viewing some PDF files without embedded fonts, xpdf complains:

$ xpdf fakeroot-nl.pdf
Error: Couldn't create a font for 'Times-Roman'
Error: Couldn't create a font for 'Times-Bold'
Error: Couldn't create a font for 'Times-Roman'
Error: Couldn't create a font for 'Times-Bold'
[...etc...]

and shows an empty file. When trying to convert such a pdf file to
PostScript, I get the same error message that appeared in the printing
log:

$ pdf2ps fakeroot-nl.pdf fakeroot-nl.ps
Error: /invalidfont in /findfont
Operand stack:
[...rest deleted for brevity...]

After a lot of Googling and experimenting, I found the solution of this
problem in setting the GS_LIB variable to /usr/share/libwmf/fonts. This
directory is actually part of the libwmf package. Since this variable
is not set by default, it seems to me that the Ghostscript installation
is broken by default on Slackware. I also fail to see what libwmf has to
do with Ghostscript or why Ghostscript would require fonts from this
package, but it does. It appears these basic fonts are missing from the
ghostscript-fonts-std package.

So I previously made a /etc/profile.d script to set this variable on
every login, but this does not affect the execution of foomatic-rip by
CUPS and therefore doesn't solve my printing problem. So what I needed
was a way to have foomatic-rip execute 'gs' (Ghostscript) with the
GS_LIB environment variable set appropriately.

Reading the foomatic-rip script tells me it executes foomatic-gswrapper
to launch Ghostscript, and the foomatic-gswrapper script in turn reads
the /etc/foomatic/filter.conf configuration file.

So I finally solved my printing problem by editing the 'gspath' option
in filter.conf so that 'gs' is executed with GS_LIB set in the
environment, as follows:

# set gspath to the GhostScript to be used by foomatic
gspath: /bin/env GS_LIB=/usr/share/libwmf/fonts gs

Printing works now in all cases, but it still feels like an ugly hack. I
hope Ghostscript will get fixed in a future Slackware release so that
it can find basic fonts by default.

I hope this helps someone at some point.

- M.

0 new messages