[cairo] Line width in poppler
Adrian Johnson
ajohnson at redneon.com
Tue Aug 4 05:42:52 PDT 2009
Carlos Garcia Campos wrote:
> Hi all,
>
> we have several bugs[1],[2] in poppler complaining about not visible
> lines. The thing is that PDF allows 0 width lines: "A line width of 0
> shall denote the thinnest line that can be rendered at device
> resolution: 1 device pixel wide". We have already a 'workaround' for
> this in poppler:
>
> if (state->getLineWidth() == 0.0) {
> /* find out how big pixels (device unit) are in the x and y directions
> * choose the smaller of the two as our line width */
> double x = 1.0, y = 1.0;
> cairo_device_to_user_distance(cairo, &x, &y);
> cairo_set_line_width (cairo, MIN(fabs(x),fabs(y)));
> }
>
> This seems to work for 0 width lines, but it doesn't work when the line
> width is < 1. So the question is, should we adjust the line width
> somehow when it's is less than the minimum device line width? how?
Adobe Reader paints every pixel that intersects the line no matter how
small the intersection [1]. If the aim is to make small width lines
render similar to acroread then line widths less than 1 device pixel
wide should be adjusted to be 1 device pixel wide.
[1] PDF Reference 1.6 section 6.5.
More information about the cairo
mailing list