[cairo] line width = 0.0 ?

Keith Packard keithp at keithp.com
Sat Jan 7 11:02:25 PST 2006


On Sat, 2006-01-07 at 19:01 +0100, Christian Krause wrote:

> 1. What is the meaning of a line width = 0.0? Should the line be visible?

It doesn't draw anything. Because cairo can usefully draw sub
pixel-width lines, and because it has an affine transform that affects
the visible line width, it really can't do anything different; you'd
have lines 'underflow' to 0.0 line width and suddenly become visible
again?

> 2. How can the following achieved in cairo (as e.g. required in the
> pdf specification):
> "Draw the thinnest line which can be rendered in the current context"?

There is no limit to the width of a renderable line in cairo; any
non-zero width can have a visible effect on the screen.

If you're asking for the 'postscript' definition of zero width lines,
I'll note that many implementations don't actually draw one pixel width
lines on high resolution devices. Instead, the effective definition of a
postscript zero width line is a line whose width is about 1/300 of an
inch...

So, if you're interested in drawing Postscript '0 width' lines, you
might consider just using 1/300th of an inch as the nominal width. These
will still be faintly visible on the X screen at 1-1 resolution, and
when zoomed will appear with a reasonable relative width.

-keith

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060107/aee413a2/attachment-0001.pgp


More information about the cairo mailing list