Bug 695031

Summary: Error: /typecheck in /findfont with WOFF fonts in font path
Product: Ghostscript Reporter: Mike Miller <mtmiller>
Component: PS InterpreterAssignee: Chris Liddell (chrisl) <chris.liddell>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: master   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: trivial postscript example

Description Mike Miller 2014-02-11 06:12:29 UTC
Created attachment 10688 [details]
trivial postscript example

The following error occurs:


$ GS_FONTPATH=/usr/share/fonts ~/src/ghostpdl/gs/bin/gs -dQUIET -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dEmbedAllFonts=true -dOptimize=true -sOutputFile=test.pdf test.ps
Error: /typecheck in /findfont
Operand stack:
   NotInstalledFont
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1934   1   3   %oparray_pop   1933   1   3   %oparray_pop   1917   1   3   %oparray_pop   1803   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1886   1   3   %oparray_pop
Dictionary stack:
   --dict:1188/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Current file position is 42
GPL Ghostscript GIT PRERELEASE 9.11: Unrecoverable error, exit code 1

when a font search is required and a WOFF font file is installed in the font path. Debian has started providing WOFF fonts under /usr/share/fonts/woff, which makes them fall under Ghostscript's default system search path.

Should be reproducible on git master with the attached trivial postscript file and a WOFF font such as http://fortawesome.github.io/Font-Awesome/ in the font path.
Comment 1 Chris Liddell (chrisl) 2014-02-11 06:30:31 UTC
I can't reproduce this on Ubuntu (I'll try on Debian later).

Please don't use "-dQUIET" when posting the output, it might be hiding important information before the actual error.
Comment 2 Chris Liddell (chrisl) 2014-02-11 07:56:54 UTC
Okay, I can reproduce the problem on Debian - no idea why it doesn't go wrong on Ubuntu..... I'm looking into it now.
Comment 3 Mike Miller 2014-02-11 19:07:27 UTC
Great, thanks for looking into this so quickly, glad you are able to reproduce. Let me know if you need me to test anything else.
Comment 4 Chris Liddell (chrisl) 2014-02-12 00:47:03 UTC
This fixes the problem for me:
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=f4584b0e

The patch is in the Postscript resource files, so you can apply it to your existing installation without rebuilding the whole package. The patch goes in the file:

/usr/share/ghostscript/<gs version>/Resource/Init/gs_fonts.ps

where "<gs version>" is the version number of the Ghostscript that's installed. So on my Debian install it is:

/usr/share/ghostscript/9.05/Resource/Init/gs_fonts.ps
Comment 5 Mike Miller 2014-02-12 06:09:23 UTC
Looks good to me, tested both rebuilding from git master and applied to the Debian package, both work now with these fonts installed. Thanks!