Ralph found this during 8.71 release test using Bug687832.pdf. Procedure: $ bin/gs -sDEVICE=pdfwrite -o Bug687832.pdf.pdf Bug687832.pdf $ bin/gs -sDEVICE=png16m -o Bug687832.pdf.pdf.png Bug687832.pdf.pdf This results large spaced letters in Bug687832.pdf.pdf.png. Acrobat 9 renders Bug687832.pdf.pdf same as gs. With gs 8.70, this doesn't make wrong output. With r10602, this resulted 4 times larger spacing, and with r10603 (which was a fix for bug #687832), this resulted double spaced letters (same as current). I am working on reduced and openable test code.
Fist of all, please forget what I said about r10602 yesterday. Today r10602 renders exactly same image with r10603. I must have done something wrong yesterday. Second, I wrote a test code about what I believe the cause of this isssue, which is 2048x2048 grid designed CIDFont. It displayed similar symptom with current head, while it also went wrong even with gs 8.70. I think my code might have discovered another issue. I will attach that code later, or I may open another bug about it. Last, search-svn-revs (what a nice tool!) told me that this symptom first introduced with r10476. I will look further to find the cause of this issue.
Created attachment 5947 [details] Bug691103.ps Before r10476, pdfwrite converted CIDFont letters in Bug687832.pdf into graphic objects (not a font). I think the change in r10476 fixed a problem that had been covering this problem which have been there for a long time. So I consider this file must be the simplest case to exhibit this issue. Procedure to reproduce: $ bin/gs -sDEVICE=pdfwrite -o Bug691103.ps.pdf Bug691103.ps $ bin/gs -sDEVICE=pngmono -o Bug691103.ps.pdf.png Bug691103.ps.pdf
Bug691103.ps.pdf generated in above command line contains a 'W' array which says: /W [0 [2048]] The number 2048 is in glyph space (this is a CIDFont with 2048x2048 glyph space) and this is wrong. It should be 1000, which is in 1000th of text space.
The problem is not just that pdfwrite is ignoring FDArray font's FontMatrix, but also that orig_FontMatrix is not working for CIDFont at all. I need to fix that too.
Created attachment 5979 [details] Bug691103_2.ps A new test file. First line is with same CIDFont with minor fix, second line is a Type 1 Font with 2048x2048 glyph space. I found it useful while debugging.
Created attachment 5986 [details] b691103_b2.patch A patch. Bug687832.pdf and Bug690834.ps show differences but those are improvements.
The patch looks good to me, you've obviously done regression tests so I think you should go ahead and commit it. Thanks for working on this one!
The patch had been committed r10810 at Feb 25. Closing this bug as fixed. --- r10810 | masaki | 2010-02-25 17:21:46 +0900 (Thu, 25 Feb 2010) | 3 lines Fix for bug 691103. The pdfwrite device now considers FDArray fonts' FontMatrix and writes correct W/W2/DW/DW2 widths for CIDFont with unusual FontMatrix. This also fixes a problem gs_font::orig_FontMatrix not being initialized for CIDFont. Bug687832.pdf and Bug690834.ps will show differences which are improvements.