FS#76565 - ghostscript-10.0.0-2 fails to convert some pdfs correctly

Attached to Project: Arch Linux
Opened by Robin Becker (replabrobin) - Monday, 14 November 2022, 15:29 GMT
Last edited by Andreas Radke (AndyRTR) - Wednesday, 16 November 2022, 15:20 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Andreas Radke (AndyRTR)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: After upgrade ghostscript fails to render some pdfs correctly


Additional info:
* package version(s)
ghostscript 10.0.0-2

* link to upstream bug report, if any
https://bugs.ghostscript.com/show_bug.cgi?id=706074

Steps to reproduce:
install ghost-script-10.0.0-2
using the pdf from the bug report render to jpeg using

/usr/bin/gs -q -dSAFER -dNOPAUSE -dBATCH -sOutputFile=test_multibyte_jpn-page%04d.jpg -sDEVICE=jpeg -r72x72 -f test_multibyte_jpn.pdf

The heisei fonts are not rendered correctly. It seems that cmaps that are prsent in 9.56.1 are no longer seen/found. I assumed that it's the use of poppler CMaps that is the issue. If I comment line 60 of the PKGBUILD rm -r Resource/CMap then the package builds and I do see the heisei fonts in the rendered jpegs.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Wednesday, 16 November 2022, 15:20 GMT
Reason for closing:  Fixed
Comment by Andreas Radke (AndyRTR) - Monday, 14 November 2022, 21:49 GMT
All three CMap files mentioned in the upstream report are present in poppler-data package:

poppler-data /usr/share/poppler/cMap/Adobe-Japan1/90ms-RKSJ-V
poppler-data /usr/share/poppler/cMap/Adobe-Japan1/EUC-V
poppler-data /usr/share/poppler/cMap/Adobe-Japan1/UniJIS-UCS2-H

Can you please share some example test file to test? Maybe one more symlink is missing in poppler-data or ghostscript. I'd like to compare to
https://packages.debian.org/bookworm/libgs10-common - looks like falling back to fonts-droid-fallback (we have in AUR)
https://gitweb.gentoo.org/repo/gentoo.git/tree/app-text/ghostscript-gpl/ghostscript-gpl-10.0.0-r1.ebuild uses poppler-data via symlink
https://src.fedoraproject.org/rpms/ghostscript/blob/rawhide/f/ghostscript.spec - symlinks to adobe-mappings-cmap-devel CMaps in a similiar way
Comment by Robin Becker (replabrobin) - Tuesday, 15 November 2022, 08:35 GMT
I attach zip with a test pdf file and the conversions to jpeg for 10.0.0 and 9.56.1

$ uname -a
Linux minikat 6.0.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 10 Nov 2022 21:14:24 +0000 x86_64 GNU/Linux
Comment by Robin Becker (replabrobin) - Tuesday, 15 November 2022, 08:52 GMT
I am not expert in JPN fonts, but looking at the reportlab test code I think the encodings being used for Heiseimin-W3 are

1) unicode
2) 90ms-RKSJ-V
3) EUC-V

I have no idea about how ghostscript searches for the cmaps, but if I comment the removal at line 60 of the PKGBUILD
then makepkg seems to create a 10.0.0 pkg which does seem to work.
Comment by Andreas Radke (AndyRTR) - Wednesday, 16 November 2022, 10:52 GMT
Please test with poppler-data-0.4.11-3.
Comment by Robin Becker (replabrobin) - Wednesday, 16 November 2022, 12:18 GMT
Hi, after installing poppler-data-0.4.11-3 with the extra links in /usr/share/poppler/cMap/

I see the right glyphs in the jpegs produced by gs from ghostscript 10.0.0-2.

I think this resolves the problem for me.

Loading...