GNOME Bugzilla – Bug 503290
too thick barlines from GNU LilyPond PDF
Last modified: 2011-08-22 07:19:24 UTC
When rendering a GNU LilyPond PDF score for previewing or printing, barlines (coded as very thin round rectangles) look much thicker than it should do. Plain viewing looks OK but printing is poor looking. Other vertical lines do not have this problem. A printing preview in evince shows the same problem, no need to actual printing on paper. Other viewers/printers like kpdf do this task correctly. see samples in: http://www.paconet.org/laserjet-png.png http://www.paconet.org/laserjet-pdf.png previous message discussing this issue: http://article.gmane.org/gmane.comp.gnu.lilypond.general/33087/match=barline+thickness BTW LilyPond outputs a .ps file, then converts it to PDF. This intermediate PS file looks OK as well, at a first glance. Tested in Ubuntu Gutsy.
Created attachment 100848 [details] a minimal LilyPond score that shows the problem to generate the PDF, do lilypond minimal.ly
Created attachment 100850 [details] sample PDF output from LilyPond This PDF is the output generated by lilypond from minimal.ly sample score. It tries to show the way in that evince renders the barline at the rightmost edge too thick, but not on normal screen, but on preview or through printer.
Created attachment 100851 [details] PS output from minimal sample score file This is an intermediate file that LilyPond converts to PDF and it then shows the barline problem whan previewed or printed in evince.
The PS code that causes the problem is at the end of the file: 113.6210 -15.8287 moveto 0.1900 4.1000 0.0000 -2.0500 0.0000 draw_round_box draw_round_box is defined as /draw_round_box % width height x y blot { setlinewidth % w h x y 0 setlinecap 1 setlinejoin rmoveto % w h currentpoint % w h x1 y1 4 2 roll % x1 y1 w h 4 copy rectfill rectstroke } bind def but I have not been able to isolate this line alone in the PS file.
Is the problem still here ? (I don't know how to use Lillypond to test this one)
Yes it is there. How to use lilypond to test this is explained in my comment above. Just use the minimal file attached as id #100848 and use it as an argument of the lilypond command. Then open the resulting PDF. Also, in mutopiaproject.org you have 1620 lilypond-generated PDFs to test. This bug is annoying because lilypond scores printed from evince are ugly, compare its barlines with the ones printed from lpr directly or through acroread
Poppler is the guilty here, I think.
Why don't you report this to Poppler on bugs.freedesktop.org? You may get more attention there.
The problem has been fixed in poppler git. It was caused by stroking a zero width line. This is supposed to draw the thinnest line possible on the output device. As cairo does not support 0 width lines, poppler was setting the line width of a 0 width line to 1 unit. This is correct for the screen where 1 unit == 1 pixel is the thinnest line. But when printing 1 unit == 1/72" which is too thick. I'm not sure why LilyPond wants to fill a rectangle then stroke a 0 width line around it. The second step seems to be redundant. The PDF Reference says that 0 width lines should not be used because the result is device dependent.
Thanks Adrian!