Bug 690220

Summary: Ghostscript does not reproduce bold text correctly when converting PostScript output of OpenOffice to PDF
Product: Ghostscript Reporter: Till Kamppeter <till.kamppeter>
Component: PDF WriterAssignee: Ken Sharp <ken.sharp>
Status: RESOLVED DUPLICATE    
Severity: critical    
Priority: P4    
Version: master   
Hardware: All   
OS: All   
URL: https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/314018
Customer: Word Size: ---
Attachments: openoffice-bold-ps-output.ps
ps2pdf-gs-864.pdf
ps2pdf-gs-863.pdf
results.tif

Description Till Kamppeter 2009-01-05 11:31:14 UTC
See

https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/314018

If one prints from OpenOffice.org, the application produces PostScript data.
Ubuntu Intrepid uses a PDF printing workflow and therefore CUPS converts it to
PDF using Ghostscript. The bold letters appear completely distorted on the
printout. To prove that really the PS->PDF conversion of GS is the culprit (and
not for example the printer driver) simply print to a file from OpenOffice.org
(with the "Generic Printer", if this printer does not appear, stop CUPS and
restart OpenOffice.org) and then do

ps2pdf out.ps

out.pdf shows the distorted bold text. I attach a sample PostScript file
generated with OpenOffice.org. So you can also test without having
OpenOffice.org handy.

The text is completely distorted with GS 8.63. It comes out normal instead of
bold with GS 8.64 (HEAD of SVN), so there is still a fix needed for 8.64.
Comment 1 Till Kamppeter 2009-01-05 12:08:30 UTC
Created attachment 4679 [details]
openoffice-bold-ps-output.ps

PostScript output of OpenOffice.org (print to file), with bold text
Comment 2 Till Kamppeter 2009-01-05 12:15:53 UTC
Created attachment 4680 [details]
ps2pdf-gs-864.pdf

Output of the command line

GS_LIB=Resource/Init/ bin/gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer
-sOutputFile=ps2pdf-gs-864.pdf openoffice-bold-ps-output.ps

executed in the source directory of Ghostscript, current SVN snapshot, after
compiling.

Originally bold letters are not bold any more.
Comment 3 Till Kamppeter 2009-01-05 12:20:22 UTC
Created attachment 4681 [details]
ps2pdf-gs-863.pdf

Output of

ps2pdf openoffice-bold-ps-output.ps ps2pdf-gs-863.pdf

on an Ubuntu Intrepid system with Ghostscript 8.63. GS 8.63 was rebuilt without
the CJK patches. So the problem is not caused by the CJK patches.

The originally bold text is completely distorted.
Comment 4 Till Kamppeter 2009-01-05 12:22:32 UTC
As I did not install 8.64 yet, I do not know whether the complete distortion is
caused by the way how ps2pdf or /usr/lib/cups/filter/pstopdf call Ghostscript or
whether most of the problem is already fixed in 8.64 and only a "last polish" is
needed.
Comment 5 Till Kamppeter 2009-01-05 13:05:04 UTC
Now I have also tested with an installed Ghostscript 8.64, so that I could
actually use ps2pdf. This gives the same result as my test with the GS 8.64 in
the source tree. The originally bold font comes out readable but not bold.
Comment 6 Ken Sharp 2009-01-06 01:04:52 UTC
Created attachment 4683 [details]
results.tif

Till, I've taken a look at this, and I don't see a problem. Probably I'm
missing something obvious.

The 8.63 output exhibits the well known (to me) issue with incorrect stroke
widths, there have been a number of fixes in this area, and I thought this was
now correct. I agree that the text in 8.64 does not seem especially bold, but
there is emboldening taking place. 

If you open the files in Acrobat, select some of the text, and then right-click
and select properties, the dialog shows that the text has a 0.4 stroke width.
That is, the text is first drawn, and then outlined with a stroke, which
effectively makes it bolder. The 8.63 code got the width of the stroke
incorrect.

Now, I've taken your file, converted to PDF using GS (HEAD) and again using
Acrobat Distiller 7. I then used the HEAD GS revision to render all three files
(original PostScript and both PDF files) at 600 dpi. To my eye the results are
effectively identical (there are some minor pixel differences).

I've attached a screenshot here, the top window (orig.pbm) is the result of GS
on the original PostScript file. The middle window (out.pbm) is the result of
rendering the GS PDF file. The bottom window is the result of rendering the PDF
produced by Acrobat.

I also ran the PDF file you sent from 8.64 (not pictured in screen shot) and it
looks identical to the other outputs.

Can you explain what is wrong ?
Comment 7 Till Kamppeter 2009-01-06 01:19:53 UTC
I have checked it with Ghostscript (gv) as screen renderer now. The input and
output really look identical now. Poppler (renderer of evince) seems to have bug
here.
Comment 8 Ken Sharp 2009-01-06 01:30:31 UTC
Thanks Till, glad to hear its OK.
Comment 9 Till Kamppeter 2009-01-06 07:28:37 UTC
This is a duplicate of bug #689970. Marking as such.

*** This bug has been marked as a duplicate of 689970 ***