Bug 267625 - print/ghostscript9-agpl-base: custom patches break ps2pdf conversion
Summary: print/ghostscript9-agpl-base: custom patches break ps2pdf conversion
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-07 19:24 UTC by Michael Osipov
Modified: 2023-12-31 10:05 UTC (History)
4 users (show)

See Also:
michael.osipov: maintainer-feedback-


Attachments
EPS file which makes conversion fail (806.18 KB, application/x-gzip)
2022-11-07 19:25 UTC, Michael Osipov
no flags Details
Git-formatted patch (5.57 KB, patch)
2022-11-11 08:01 UTC, Michael Osipov
no flags Details | Diff
Git-formatted patch (6.03 KB, patch)
2022-11-11 08:03 UTC, Michael Osipov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Osipov 2022-11-07 19:24:14 UTC
When I try to convert an EPS graphics created with Adobe Illustrator which is fairly simple, it references CJK fonts, none of them are used (can't change that), just plain ASCII glyphs. The process fails which is actually invoked from xelatex (TeX Live 2022):
===============
$ freebsd-version
12.3-RELEASE-p8
$ ps2pdf Schichtdicke.eps
Error: /undefinedresource in resourcestatus
Operand stack:
   false   ct_StyleDicts   --dict:0/4(L)--   Adobe-Japan1   --dict:0/4(L)--   Serif   HeiseiMin-W3-83pv-RKSJ-H   Font   HeiseiMin-W3   CIDFont
Execution stack:
   %interp_exit   .runexec2   --nostringval--   resourcestatus   --nostringval--   2   %stopped_push   --nostringval--   resourcestatus   resourcestatus   false   1   %stopped_push   1990   1   3   %oparray_pop   1990   1   3   %oparray_pop   1989   1   3   %oparray_pop   1988   1   3   %oparray_pop   resourcestatus   1977   1   3   %oparray_pop   1833   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   resourcestatus   --nostringval--   2   %stopped_push   --nostringval--   resourcestatus   resourcestatus   1919   10   9   %oparray_pop
Dictionary stack:
   --dict:767/1123(ro)(G)--   --dict:0/20(G)--   --dict:91/200(L)--   --dict:57/75(L)--   --dict:2/10(L)--   --dict:39/70(L)--   --dict:0/4(L)--   --dict:0/4(L)--   --dict:20/27(ro)(G)--   --dict:20/26(ro)(G)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.56.1: Unrecoverable error, exit code 1
===============

Doing the same on a vanilla GS successfully converts this file. Tracing down I have identified that patches patch-Resource_Init_cidfmap and patch-Resource_Init_FAPIcidfmap break the configuration. As soon as they are removed conversion works. Those mappings refer to paid fonts which aren't available on vanilla systems/setups. I do also not intend to install any Adobe fonts on the target machine.

Please remove or reconsider these files because patches must not break a standard setup.
Comment 1 Michael Osipov 2022-11-07 19:25:51 UTC
Created attachment 237925 [details]
EPS file which makes conversion fail
Comment 2 Michael Osipov 2022-11-11 08:01:13 UTC
Created attachment 238008 [details]
Git-formatted patch

Here is a patch which fully addresses this issue.
Comment 3 Michael Osipov 2022-11-11 08:03:46 UTC
Created attachment 238009 [details]
Git-formatted patch
Comment 4 Michael Osipov 2023-01-27 08:16:19 UTC
Hiroki, can you have a look and either remove or fix the patch?
Comment 5 Chad Jacob Milios 2023-03-24 18:30:13 UTC
ran into same problem with a couple EPS files from Shutterstock. was using 13.2-RC4/amd64 and current ports tree. then followed your advice--great success!

dont really understand what files/patch-Resource_Init_{FAPI,}cidfmap accomplished, but removing them solved my immediate issue

Thank you, Michael Osipov
Comment 6 Michael Osipov 2023-03-24 18:47:11 UTC
(In reply to Chad Jacob Milios from comment #5)

Chad, you might want to look at my Ghostscript 10 port under Bug 269302. It does contain any changes to the PS/PDF processing engine. So it is basically a vanilla GS w/o the headaches. I will have to leave GS 9 behind because of this :-(

Thanks for the praise! Took me some time to narrow down the cause.
Comment 7 Michael Osipov 2023-03-29 12:10:22 UTC
(In reply to Chad Jacob Milios from comment #5)

Chad, print/ghostscript10 has just been comitted to main. It does not have the custom patch and your case should work w/o modifications.
Comment 8 Michael Osipov freebsd_committer freebsd_triage 2023-12-31 10:05:28 UTC
print/ghostscript9 has been removed.