W3C home > Mailing lists > Public > www-style@w3.org > April 2005

Anti-aliasing border corners [spin-off of Style confirmation descriptors]

From: Barry <wassercrats@hotmail.com>
Date: Sun, 10 Apr 2005 18:52:31 -0400
Message-ID: <BAY102-DAV9447654CEA94075504185B9310@phx.gbl>
To: "Laurens Holst" <lholst@students.cs.uu.nl>, <www-style@w3.org>

Laurens Holst wrote:
> Besides, even when you would have a need for anti-aliased horizontal or 
> vertical lines (this could happen when drawing borders on non-whole-pixel 
> boundaries, which I don’t think is a good idea), it wouldn’t make anything 
> larger, the borders would still be exactly 1 pixel wide.

> In any case, there’s nothing much mysterious about anti-aliasing, and it 
> can be entirely handled by the user agent and CSS doesn’t need to worry 
> about it.

I looked at a <span style = "font-family: verdana; font-size: 
160pt;">P</span> with and without Windows XP font smoothing. With font 
smoothing, the straight top part of the "P" gained an extra pixel in width 
for a length of five pixels. This reduced the straight, equal-widthed 
section from 31 pixels to 26 pixels in length. With more aggressive 
anti-aliasing, it would be reduced even more.

If you specify a two-pixel top margin for text contained within a border 
with rounded corners, there might be only one pixel above the text for a 
length of several pixels, or maybe for the entire length of the top border, 
depending on the extent of the anti-aliasing. I don't know enough about 
anti-aliasing to know how aggressive the anti-aliasing would need to be 
before an entire top border would be an extra pixel thick. I'm just raising 
this issue incase it really could be an issue.

It might have to be made clear to the web developer whether the margins 
being set will be measured from the border as though there was no 
anti-aliasing, or if the margins will be measured from the anti-aliasing 
pixels. If there are no standards for this, it could be done either way, 
depending on the browser. There are three ways this issue can be addressed:

1. Create standards for how margins are handled in the event of anti-aliased 

2. Have text be anti-aliased whenever border corners are anti-aliased. Not a 
good option.

3. Make sure the straight parts of borders aren't thickened by 
anti-aliasing. I don't like this either.

If a web developer chooses rounded corners, he'll know about the obvious 
effect of there being less corner space, but extra pixels that thicken the 
"straight" sides of the border might pose a problem--without standards.

And as long as you're creating these standards, and since border-radius is 
pretty much useless without anti-aliasing, you might as well add an 
anti-alias property. 
Received on Sunday, 10 April 2005 22:52:30 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:17 UTC