[cairo] line width questions

Ian Britten britten at caris.com
Mon Aug 18 05:35:31 PDT 2008

Simon Budig wrote:
> Ian Britten (britten at caris.com) wrote:
>> Just a couple of quick questions about set_line_width()
>> [ Disclaimer - Yes, I read the FAQ.  Those aren't my questions ]
>> First, is there a quick/easy way to draw a line "as thin as possible"?
> Well, how would you define "as thin as possible" when lines with a
> width smaller than 1 device pixel are allowed and get rendered nicely?

Beats me, which is why I asked!  :)

Seriously though, as I originally described, most graphics systems
have an idiom to draw a line as thin as they possibly can, while still
actually drawing the line.  This is often done by setting the the
thickness to zero (eg: PS behaves this way, and with X, a thickness
of zero draws a 1-pixel wide line).

Since a thickness of zero seems to draw no line with Cairo, how
am I to know what the thinnest possible line can be (Esp. when
accounting for different surface types!).

My main problem is that "1 device unit" is unacceptably thick in PDF
(Can anyone tell me what the PDF device units are?  Points maybe?).
So how small can I specify the thickness? 0.5? 0.01? 0.000000001?
And how am I supposed to know this, short of experimenting?

Again, thanks for any information!

More information about the cairo mailing list