• Adrian Johnson's avatar
    cairo: fix stroking of very thin lines · cfc67afe
    Adrian Johnson authored
    Lines with a width less than 1.0 are almost invisible in cairo output
    due to antialising. The PDF standard states that when the Stroke
    Adjust graphics parameter is true, all lines must be at least one pixel wide.
    Add a stroke_adjust flag to the CairoOuputDev. Like splash, use the
    globalParam strokeAdjust setting (which defaults to true) to
    initialize the flag and ignore the Stroke Adjust settng in PDF
    files. This emulates Acrobat behavior.
    When stroke_adjust is true, find the line width in device pixels and
    if less than 0.5 set the line width to 0.5 device pixels. The value
    0.5 pixels seems to make horizontal and vertical lines look better
    because integer aligned 1.0 wide lines in cairo are rendered two
    pixels wide which looks too fat.
CairoOutputDev.h 18 KB