[cairo] Re: Options for disabling antialiasing (was: Re: Cairo developers conference call...)

Ravindra rkumar at novell.com
Mon Oct 18 03:41:53 PDT 2004

On Sat, 2004-10-16 at 00:04, Carl Worth wrote:
> Do you have an example of this SWF output I can look at? And could you
> explain what it is that you want to be different?

Following is a URL where I have blogged about it with some screenshots,
You might need to download the images and see full screen to figure the
subtle differences. (Please ignore the differences that are because of
our code like background color etc. We will be fixing them.) Some of the
differences that we want to bring out are, line thickness, line color
(white does not come out as pure white), fonts, tick mark inside a
checkbox (it's a line basically) etc. In simple words, our main concerns
are drawing small font text and stroking thin lines.

> When talking about a desire to "turn off antialiasing" I think it's
> important to determine what's really wanted, and see what we can do to
> achieve that. The architecture of cairo does not lend itself to skipping
> the do_antialiasing() function call or anything like that. But cairo is
> intended to let you draw what you'd like to draw. So, help us understand
> what it is you are trying to do.

I don't know whether it is possible or not in the Cairo code path, but I
was wondering if we could do following in Cairo,

if (antialiasing) {
   // do the drawing
} else {
   // do non-antialiased

But, anyway this is not the point. Our aim is to just get the output
that is close to what we see on MS.

> Instead, I'd like to see a more general approach for getting automatic
> snapping to device-pixel boundaries regardless of the line width and the
> nature of the CTM. For a long time, I had thought that the snapping
> should belong in layers above cairo, but I'm now leaning toward putting
> directly into cairo. This would of course be controlled by some switch
> in the graphics state so it wouldn't interfere when when not desired,
> (eg. when trying to do animation involving sub-pixel position, such as a
> smooth zoom).

I like the generic snapping approach with a switch, if it can fulfill
our requirement of getting an output similar to MS. FYI, with MS GDI+,
if we draw a 1-pixel line or 0 width line, we get one device pixel on
the screen.

> Keith has been playing with automatic snapping in his twin code with
> good results.

I just had a look at the image put up by Keith on the URL posted in the
other mail. But, I saw some blurred text there too. I'm not sure would
we always be able to get clean output with the snapping approach.

Thanks and regards,
 - Ravi

More information about the cairo mailing list