[cairo] Cairo developers conference call 2004-10-19 18:00 UTC

Bill Spitzak spitzak at d2.com
Fri Oct 15 10:22:17 PDT 2004

On Friday 15 October 2004 08:46 am, Ravindra wrote:
> 1. Antialiasing
> WHY: We don't want antialiasing always on. We would like to set it
> on/off as required. If you see our SWF output, you would know why do we
> need this.

Although I agree that something is needed, I feel that the only thing wanted 
is non-anti-aliased horizontal and vertical 1-pixel thick lines. I do not 
like the idea of turning antialising on/off.

My preference is to have the line width control, when set to zero, to 
completely alter the "stroke" mechanism so that line ends are rounded to the 
nearest center of a pixel (with integer ends going down and to the right) and 
a 1-pixel line drawn, complete with anti-aliasing except that horizontal and 
vertical lines are guaranteed to not be antialiased. Line caps would be in 
effect forced to 1/2 pixel square ends so that horizontal and vertical lines 
always fill exactly the pixel they end in. Zero-length lines would fill 
exactly the pixel they are inside.

An alternative is to have a different "stroke" call that does this. May be 
more efficient than checking for zero line width and would allow the 
zero-width to be the more mathematically correct no-op.

You may wonder if there is a problem outlining the anti-aliased fill. However 
for horizontal and vertical edges, these lines by definition completely hide 
the antialiased edge of a fill drawn at the same coordinates, no matter what 
fraction of an integer is used.

I do not believe there is any desire for aliased diagonal lines or fonts, as 
they look like crap when compared to the aliased output. Therefore there is 
no reason to emulate this, if a SWF program tries to do it, the command 
should be ignored and antialiased output produced anyway. In my experiments 
with Cairo it is pretty obvious that graphics that were designed for aliasing 
always look better in antialiasing anyway, despite occasional off-center 
artifacts because they compensated for pixel rounding.

I am also very concerned that any attempt to claim pixel-accurate replication 
of stuff from Microsoft is going to doom Cairo to be a morass of 
bug-replcation and should be strongly discouraged by making obvious 
differences, such as no-aliasing.

More information about the cairo mailing list