Comment 37 for bug 603929

Revision history for this message
In , Adrian Johnson (ajohnson-redneon) wrote :

Created attachment 50481
set minimum line width to 1

PDF has a Stroke Adjust parameter than when true requires that lines be at least 1 pixel wide. This patch adds a stroke_adjust parameter to CairoOutputDev that when true adjusts lines with a device width of < 0.5 pixels to be 0.5 pixels wide.

Like the splash backend, the Stroke Adjust parameter is initialized from the globalParam setting (with default value true) and overrides the setting in the PDF file. This emulates Adobe Reader where the Stroke Adjust is controlled by the "Enhance Thin Lines" setting in Preferences (defaults to true) that overrides the SA in the PDF file.

I found a minimum line of of 0.5 to produce better results than using 1.0 because unaligned horizontal and vertical 1.0 width lines in cairo are rendered 2 pixels wide. The test case in bug 14315 is a good example.