Bug 691913

Summary: PCL files generated from ghostscript 'bust the font cache'
Product: Ghostscript Reporter: Robin Watts <robin.watts>
Component: Font APIAssignee: Chris Liddell (chrisl) <chris.liddell>
Status: RESOLVED FIXED    
Severity: normal CC: sphinx.pinastri
Priority: P4    
Version: master   
Hardware: All   
OS: All   
Customer: Word Size: ---

Description Robin Watts 2011-01-28 00:40:51 UTC
Created attachment 7163 [details]
100page.pdf

If you run the attached file through ghostscript as follows:

 gswin32c.exe -sDEVICE=pxlcolor -r600 -o out.pxl 100page.pdf

The generated files contain fonts where the glyphs are not reused on each successive page. (So the 'A' character on the second page is redefined from that of the 'A' character on the first page etc). This produces files that are not only larger than required, but also perform poorly in the PCL interpreter.

Investigating the code, it seems that pclxl_copy_text_char is being called. We look up the char index using pclxl_char_index and fail to spot it is one we've had before. This is because this function is being called from above with a unique glyph id. We should reasonably expect the glyph id to be the same the second time a glyph is encountered.
Comment 1 Peter Cherepanov 2021-01-04 04:55:21 UTC
This problem is fixed. The generated PXL file is now more than 2 times shorter. The dump file by pxldis now has only 158 CharCode operations vs 150072 in the v. 8.62.