Created attachment 755549 [details] one postcript file generated by enscript , which shows this problem Description of problem: For a number of years now, ghostscript on fedora running against any ps files which requires the standard 13 fonts (basically those generated by a2ps or enscript) fails with: $ gs gs-redhat-buzilla.ps GPL Ghostscript 9.06 (2012-08-08) Copyright (C) 2012 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.06/Resource/Font/NimbusMonL-Bold. Can't find (or can't open) font file NimbusMonL-Bold. Can't find (or can't open) font file /usr/share/ghostscript/9.06/Resource/Font/NimbusMonL-Bold. Can't find (or can't open) font file NimbusMonL-Bold. Querying operating system for font files... Error: /limitcheck in /findfont Operand stack: fontdict Courier-Bold Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1894 1 3 %oparray_pop 1893 1 3 %oparray_pop 1877 1 3 %oparray_pop 1771 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 1852 2 3 %oparray_pop Dictionary stack: --dict:1161/1684(ro)(G)-- --dict:0/20(G)-- --dict:107/200(L)-- Current allocation mode is local Current file position is 10654 GPL Ghostscript 9.06: Unrecoverable error, exit code 1 Version-Release number of selected component (if applicable): $ rpm -q ghostscript ghostscript-9.06-4.fc18.x86_64 ghostscript-9.06-4.fc18.i686 How reproducible: Always, for a number of years now. Steps to Reproduce: 1. run a2ps or enscript on any text file. 2. type "gs gs-redhat-buzilla.ps" 3. Actual results: $ gs gs-redhat-buzilla.ps GPL Ghostscript 9.06 (2012-08-08) Copyright (C) 2012 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.06/Resource/Font/NimbusMonL-Bold. Can't find (or can't open) font file NimbusMonL-Bold. Can't find (or can't open) font file /usr/share/ghostscript/9.06/Resource/Font/NimbusMonL-Bold. Can't find (or can't open) font file NimbusMonL-Bold. Querying operating system for font files... Error: /limitcheck in /findfont Operand stack: fontdict Courier-Bold Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1894 1 3 %oparray_pop 1893 1 3 %oparray_pop 1877 1 3 %oparray_pop 1771 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 1852 2 3 %oparray_pop Dictionary stack: --dict:1161/1684(ro)(G)-- --dict:0/20(G)-- --dict:107/200(L)-- Current allocation mode is local Current file position is 10654 GPL Ghostscript 9.06: Unrecoverable error, exit code 1 Expected results: Something similar to binary build from source: $gs gs-redhat-buzilla.ps GPL Ghostscript GIT PRERELEASE 9.08 (2013-01-29) Copyright (C) 2012 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Loading NimbusMonL-Bold font from %rom%Resource/Font/NimbusMonL-Bold... 3300584 1930164 3934392 2634395 1 done. Loading NimbusMonL-Regu font from %rom%Resource/Font/NimbusMonL-Regu... 3300584 1981041 3934392 2643056 1 done. >>showpage, press <return> to continue<< >>showpage, press <return> to continue<< >>showpage, press <return> to continue<< >>showpage, press <return> to continue<< >>showpage, press <return> to continue<< >>showpage, press <return> to continue<< GS>quit Additional info: I occasionally work on-and-off ghostscript, so there is always a build-from-source binary around, and two of my printers I am the author of the driver of, and most of the things I print are generated from latex and therefore always have embedded CMR fonts and not using the std 13, so it has never bothered me too much about the platform's gs binary not working, but it is curious. My only guess is that the platform gs is not happy with fontconfig (and possibly the large number of fonts - I have essentially done yum -y install \*font\*) , since fontconfig seems to be the main difference between built from source vs from fedora.
Works for me. I suspect one or more of the fonts you've got installed is bad in some way. Perhaps try 'strace -eopen ...' and see which font it looked at last?
Created attachment 756268 [details] strace -eopen gs a.ps >& /tmp/whole-list strace -eopen does not show an error. OTOH, grep -i "\.ttf" /tmp/whole-list | wc -l 519 $ fc-match -a Courier | wc -l 1597 $ fc-match -a Courier | grep Courier NotCourierSans.ttf: "NotCourierSans" "Regular" NotCourierSans-Bold.ttf: "NotCourierSans" "Bold" c0419bt_.pfb: "Courier 10 Pitch" "Regular" c0583bt_.pfb: "Courier 10 Pitch" "Bold" c0582bt_.pfb: "Courier 10 Pitch" "Italic" c0611bt_.pfb: "Courier 10 Pitch" "Bold Italic"
Hmm, you might be on to something. The last font opened: /usr/share/fonts/pagul/Pagul.ttf came from pagul-fonts, "A TrueType Font, which allows you to read and write in Saurashtra Script." It is slightly strange as having non-english in the Style field with fc-match -a output. However, doing: fc-match -a | cut -f 4 -d '"' | sort | uniq -c I seems to have 14 fonts with non-English in that field, so if that's the reason, I have more problems than just that one font. May I suggest if you could install pagul-fonts, and see if it breaks your system? :-)
The pagul-fonts package is part of fedora's offerings, so if it breaks gs, it would be between the packagers? The other strange fonts with non-English/unusual styles are: Perizia.ttf: "Perizia" " Denemo.ttf: "Denemo" "obyčejné" FreeSerifItalic.ttf: "FreeSerif" "курсивен" FreeMonoOblique.ttf: "FreeMono" "наклонен" FreeSansOblique.ttf: "FreeSans" "наклонен" FreeMono.ttf: "FreeMono" "нормален" FreeSans.ttf: "FreeSans" "нормален" FreeSerif.ttf: "FreeSerif" "нормален" FreeMonoBold.ttf: "FreeMono" "получерен" FreeSansBold.ttf: "FreeSans" "получерен" FreeSerifBold.ttf: "FreeSerif" "получерен" FreeSerifBoldItalic.ttf: "FreeSerif" "получерен курсивен" FreeMonoBoldOblique.ttf: "FreeMono" "получерен наклонен" FreeSansBoldOblique.ttf: "FreeSans" "получерен наклонен" Pagul.ttf: "Pagul" " 渀漀琀 瀀" hiran-perizia-fonts, denemo-music-fonts, gnu-free-mono-fonts and pagul-fonts. Okay, not too painful if I need to remove them. Perizia seems to give a new-line for that field.
Yes, indeed, installing pagul-fonts causes my system to fail in the same way. Thanks for narrowing down the problem.
Created attachment 761469 [details] patch to clamp the name to 65535. The font is legal I think (and was created by fontforge, apparently), but the creator was being creative and put the entire text of the GPL inside the name table. Ghostscript reads the name table as string and is limited by postscript's implementation limit of string to 65535 (Appendix B1, PLRM). Out of the 1200+ truetype-like fonts on my system, I have 10 fonts with name above 47k and the 2nd highest being 56559 . So while being extreme, close to 65535 is not too rare.
The name is 108959 in size, and the GPL appeared to be UTF-16 encoded in the hex editor. That basically doubles the text size from about 35k to 70k. So just on its own, that part is over 65535... The limitcheck comes from readstring.
The upstream bug report may or may not be the same problem, but likely in a similar code area.
FWIW, I can't reproduce the problem on Fedora 19 Beta (ghostscript-9.07).
AFAIK, the pagul font in F19 is the same. It is possible with a different fontconfig config, the target font is found before encountering the flawed font. You could do a full scan by searching for a bogus font: /ZZXTZNZRZPSMTWhatnot findfont Or scan a specific font specifically: (/usr/share/fonts/ipa-gothic/ipag.ttf) (r) file .findttfontname not {(failed)} if = The former should take a while but come back to a message about font not found and substituting with something else; the latter should give you the font name for a ttf or a otf file ("IPAGothic" in the above case, or "Pagul" for the pagul font), or one word "failed" if you feed it an invalid file, but neither should throw a postscript limitcheck error. Those two lines are postscript code - you just start gs and cut-&-paste that in, or stick them in a file and run "gs file.ps"
A somewhat edited and integrated patch together with another fix for a related issue was committed as part of the upstream bug report Ghostscript #690692, so this patch can be dropped when the next version of ghostscript is released. The other issue addressed by the integrated patch is for Mac OS dfont font formats (detecting and skipping them correctly), so not particularly useful/urgent for Fedora.
ghostscript-9.07-10.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/ghostscript-9.07-10.fc19
Package ghostscript-9.07-10.fc19: * should fix your issue, * was pushed to the Fedora 19 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing ghostscript-9.07-10.fc19' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-13173/ghostscript-9.07-10.fc19 then log in and leave karma (feedback).
ghostscript-9.07-10.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.
*** Bug 845984 has been marked as a duplicate of this bug. ***
I have an up-to-date system and I can confirm that ghostscript-9.07-10.fc19 is installed. I have reported the issue originally thinking it was due to Okular I am trying to open that PDF with gs and I get Can't find (or can't open) font file /usr/share/ghostscript/9.07/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/9.07/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/9.07/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 reading a content stream. The page may be incomplete. **** File did not complete the page properly and may be damaged. When trying to use the ps version of that PDF I get GPL Ghostscript 9.07 (2013-02-14) Copyright (C) 2012 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.07/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/9.07/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/9.07/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: F0_999999 1 1 --nostringval-- Courier Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1884 1 3 %oparray_pop 1883 1 3 %oparray_pop 1867 1 3 %oparray_pop 1755 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 1836 5 4 %oparray_pop Dictionary stack: --dict:1163/1684(ro)(G)-- --dict:0/20(G)-- --dict:78/200(L)-- --dict:67/75(L)-- Current allocation mode is local Last OS error: No such file or directory Current file position is 12568 GPL Ghostscript 9.07: Unrecoverable error, exit code 1
Re-opening based on comment #16
(In reply to Marc-Andre Laverdiere from comment #16) > I have an up-to-date system and I can confirm that ghostscript-9.07-10.fc19 > is installed. ... > Didn't find this font on the system! > Unable to substitute for font. Can you post the /tmp/whole-list generated from (all in one line) strace -eopen gs -dNOPAUSE -dBATCH -dDEBUG your_input_file.ps >& /tmp/whole-list the next time you have one of these message with one of your your_input_file.ps ? That would help.
Is this the same bug? The original report had /limitcheck, but your run ends with /invalidfont.
Tim Waugh is right. I have given the information in the following bug. https://bugzilla.redhat.com/show_bug.cgi?id=990995
OK, re-closing. Long live bug #969660 !
For those who have an earlier Fedora version, it is easy to resolve the problem using yum remove pagul-fonts
ghostscript-9.06-8.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/ghostscript-9.06-8.fc18
ghostscript-9.06-8.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.