amitdivya / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

DejaVu Serif glyph widths problem #563

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I built the attached file using DomPDF and the Deja Vu Serif UTF-8 font. As you 
can see, the layout looks fine and the text is justified. The problem with the 
documents produced by DomPDF is that they are very large, so I usually run the 
pdf through ghostscript, which reduces the PDF size while preserving the look 
and layout. With this particular document however, after running:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=output.pdf -dBATCH input.pdf

the output contains a lot of randomly added spaces, some removed spaces and the 
justify alignment of the text is lost.

I posted this as a bug to Ghostscript, since the input file looks well and the 
output file doesn't -- the bug is filed here:

http://bugs.ghostscript.com/show_bug.cgi?id=693825

However, after they investigated the problem, they said that the font 
information stored in the PDF file is incorrect. I quote:

"The Widths array for the DejaVuSans CIDFont does not appear to match the 
actual widths of the glyphs in the font, which is causing pdfwrite to emit most 
of the characters with small horizontal kernning."

Of course, this is not a DomPDF bug in itself, but I thought that if you were 
aware of the font problem you may find an easier way to fix it, than fixing 
Ghostscript in order to accommodate the broken font would be.

As a side note, I'm not having this problem with DejaVu Sans Serif, only with 
Serif.

What is the expected output? What do you see instead?

The expected output of the gs command should look the same as the input file. 
Instead, after running the PDF through gs, the layout is broken. The 
Ghostscript team say there's a problem with the font information stored in the 
PDF.

What version of dompdf are you using? What version of PHP? On what
operating system?

@version $Id: dompdf_config.inc.php 486 2012-04-02 18:50:11Z fabien.menager $

Please provide the HTML source code you want to convert, or any additional
information.

See attached file. Run the above command. See the output. Is there any way to 
fix the font?

Original issue reported on code.google.com by freecorv...@gmail.com on 4 Apr 2013 at 6:11

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the issue. We've moved the project over to github. I recreated this 
issue there, so be sure to follow it for updates:
https://github.com/dompdf/dompdf/issues/615

Original comment by eclecticgeek on 5 Apr 2013 at 3:54

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 24 May 2013 at 3:00