Summary: | Missing Characters after PDF Write | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Dylan <dylans> |
Component: | PDF Writer | Assignee: | Alex Cherepanov <alex> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | pspencer |
Priority: | P4 | ||
Version: | 8.70 | ||
Hardware: | Macintosh | ||
OS: | MacOS X | ||
Customer: | Word Size: | --- | |
Attachments: |
Problem file
h4i7.pdf - simplified sample file. patch |
Description
Dylan
2009-08-18 13:12:52 UTC
Created attachment 5308 [details]
Problem file
This is the file that has missing characters after parsing:
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=exo_result.pdf -dBATCH exo.pdf
This does not appear to be a problem with pdfwrite. When run through GS to the display device there are a number of zlib errors (which are ignored) and a number of 'substitutuing .notdef for glyph ' errors. (The glyph errors are not present when the device is pdfwrite) I'm unsure as to whether the problem is the decompression of streams (zlib) or somethign we don't like about the font (Trebuchet, apparently). However the pdfwrite output file contains the usual hollow square for .notdef where the glyphs are 'missing'. The effect does not appear to be random, its the same glyphs missing every time. Its likely this is simply a bad PDF file, I notice the PDF Producer field is empty, never a good sign when the software is embarrassed enough to remain anonymous. The fact that Acrobat reads it and doesn't complain doesn't mean the file is valid, Acrobat silently fixes all kinds of broken files. I'm reassigning this to Alex to see if the problem is zlib, the PDF interpreter or the font. Created attachment 6234 [details]
h4i7.pdf - simplified sample file.
This is a bug in Ghostscript.
The sample file refers to the same font descriptor through
different font dictionaries with different encodings. It looks like
Ghostscript doesn't expect this.
Created attachment 6238 [details] patch Associate cached font instance with PDF font resource dictionary instead of font descriptor. The latter may be shared by font resource dictionaries with different encodings causing incorrect rendering. Besides fixing the problem, the patch causes minor rendering differences in Bug690837.pdf . Some of the characters get shifted by one pixel left or right relatively to the previous position. The patch has been committed as a rev. 11148. *** Bug 691004 has been marked as a duplicate of this bug. *** |