Bug 691913 - PCL files generated from ghostscript 'bust the font cache'
Summary: PCL files generated from ghostscript 'bust the font cache'
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Font API (show other bugs)
Version: master
Hardware: All All
: P4 normal
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-28 00:40 UTC by Robin Watts
Modified: 2021-01-04 04:55 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.