[cairo] Hairlines

Ian Britten britten at caris.com
Wed Jan 28 06:44:32 PST 2009


Hi all,
I'm still struggling with how to best handle hairlines, and am wondering
if anyone could offer some guidance/suggestions...

In my early work, I used a device thickness of 1.0/300.0 (converted to
user) as the thickness when I needed to draw these types of lines.
This seemed to work ok when outputting to PDF.  However, when I output
to an image (PNG), the lines don't visually appear (Too thin?).

OTOH, if I use a device thickness of 1.0 (converted to user) as the line
thickness, the lines look as expected in the image output.
Unfortunately, this is far too thick in the PDF output.  :(

Long story short, it seems that I'm going to have to examine the type
of surface I'm using, and use different numbers for the thickness
accordingly.  IMHO, this seems to defeat one of the abstractions that
Cairo touts - Namely drawing the same way to any surface type.
Thus, I figured I'd ask, and see if there isn't a better technique.

Thanks for any info/suggestions!
Ian


More information about the cairo mailing list