[Poppler-bugs] [Bug 50750] pdftops generates broken (according to ghostscript) postscript
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Wed May 16 22:28:43 UTC 2018
https://bugs.freedesktop.org/show_bug.cgi?id=50750
--- Comment #3 from Stefan Brüns <stefan.bruens at rwth-aachen.de> ---
Reading a bit more, I can state the following:
The PDF file is obviously broken. The /Differences array in the /Encoding dict
contains invalid/broken entries:
- The names are invalid (invalid characters)
- Different code points have the same name
While the latter is not invalid (e.g. .notdef is commonly used for all
codepoints without glyphs), it is obviously broken, as the codepoints refer to
*different* glyphs.
There are two possible solutions I can see here:
1. The file is broken. Call it a day
2. Follow the standard PDF32008-1:2008, 9.6.6.4 [1]:
---
If a (3, 1) “cmap” subtable (Microsoft Unicode) is present:
• A character code shall be first mapped to a glyph name using the table
described above.
• The glyph name shall then be mapped to a Unicode value by
consulting the Adobe Glyph List (see the Bibliography).
• Finally, the Unicode value shall be mapped to a glyph description according
to the (3, 1) subtable.
[...]
In any of these cases, if the glyph name cannot be mapped as specified, the
glyph name shall be looked up in the font program’s “post” table (if one is
present) and the associated glyph description shall be used.
[...]
If a character cannot be mapped in any of the ways described previously, a
conforming reader may supply a mapping of its choosing.
---
This will fail in the first step; it has no 'post' table, thus the third
paragraph applies.
As we know names in the AGL are ascii only, we can reject the bad names from
the differences array, and in this case end up with the names from
WinAnsiEncoding.
[1] https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf
[2] Adobe Glyph List (AGL):
https://github.com/adobe-type-tools/agl-aglfn/blob/master/aglfn.txt
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180516/ea2168d3/attachment.html>
More information about the Poppler-bugs
mailing list