[cairo] thin antialiased lines

Kalle Vahlman kalle.vahlman at gmail.com
Sun Jul 15 08:22:34 PDT 2007

2007/7/15, control H <control.h at gmail.com>:
> But that only gives the solution for horizontal and vertical lines,
> which I already use (the 0.5 offset thing in pixels).

Ah, right. Sorry for not reading your post more carefully.

> So how to draw diagonal lines smoothed but 1 pixel thick and in the
> correct (non blurred) color?

If I interpet the FAQ entry (and my limited testing) right, it's
basically saying that it's not possible to have "clean" single pixel
width lines apart from the vertical/horizontal ones that are aligned

You can get a bit better result on 45 degree angles by offsetting just
one of the dimensions, but even then it doesn't maintain the intensity
(the color is slightly faded).

> Or how to draw non anti aliased lines _nice_ lines like gdk_draw_line()?

I guess it would really help clarifying the problems here if you could
produce examples of what you are getting and what you'd like to get,
though I fear that the differences are just differences in drawing
models (gdk is pixel-based while cairo is not).

Kalle Vahlman, zuh at iki.fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi

More information about the cairo mailing list