Subpixel vs. Greyscale Antialiasing
cantina.co
cantina.co
One key here is that subpixel rendered text can't be easily composited. You essentially need RGB alpha channels so that you can blend each channel independently. Because of this if you want to build a compositing tree with bitmap caching it is very hard to do blending in hardware.
One of the lead engineers did some experiments at the time where he put together blind test of cleartype vs. high quality sub-pixel positioned, gamma correct blended grayscale text. I don't think anyone could really tell the difference. These will only get closer as resolutions increase.
The lesson is that the big 'wow' factor when cleartype was introduced was the fact that glyphs were now positioned on subpixel boundaries (instead of pixel snapping the glyph origin) and use a gamma corrected blend. The tri-channel blending was only a small part of the picture.
But -- cleartype was a unique differentiating feature and was shipped anyway.
If you are rendering solid color text, the source could be a constant. But if you are doing general composting the source needs to be another bitmap. You effectively use that mask as an RGB alpha channels.
Sorry if I'm missing something, I'm not a graphics expert at all.
In WPF/Avalon we aimed to have a generic scene graph. We were also looking to cache intermediate nodes in the scene graph and do composition of a transform on those nodes. This was to prevent the need to completely rerender a complex scene graph tree on every frame if the transformations were small enough.
The issue arises when you want to composite text onto a background and then further composite that result onto another image. If there is any transparency under the text in the intermediate cached image, cleartype/subpixel antialiasing breaks down.
So -- it is straightforward to figure out how to do a subpixel mask composition, but it is much harder when you want to take that result and composite it further.
This was a while ago so perhaps I'm misremembering though :)
It seemed that plenty of folks (myself included) found WPF text to be rather unusable until they fixed it years later (after the VS 2010 blurry text editor thing). I can't use IE because of the 'smoothed' text, but Chrome still seems to get it "right" (snaps to pixels, like in Word). Are we talking about the same thing?
At high DPI it does look fine; unfortunately high DPI didn't actually happen like Microsoft thought, just like 6GHz CPUs (both predictions at PDC 2003). Although, now that the iPad3 shipped a high DPI screen, maybe other OEMs will get their stuff together.
One of the things that I had been working on when I left Microsoft was to come up with a comprehensive 'pixel snapping' system that would start to address these issues. I was looking at taking ideas form the autohinting systems used in the font rasterizers. At the time that WPF shipped, it appeared that no one had picked up that work. I haven't tracked it since then so perhaps things have been improved.
no. The way to resolve this is to leave font rendering alone and hope for WebKit to fix the issue with 3dtransform so that at some point, it'll be able to use subpixel antialiasing everywhere.
And even if you insist on forcing grayscale on me, even though I find the subpixel one way, way more readable, then please use the official way to specify antialiasing (-webkit-font-smoothing) and don't rely on a bug by using transform3d.
When the bug is fixed in Webkit, the translation will become a no-op, and you'll get sub-pixel AA everywhere.
Meanwhile, the font rendering is consistent in animations.
I suppose a major problem is that this would require all programs to support the notion of non-square pixels, and it's late in the game to expect that. And once we have retina displays everywhere, the whole point will be moot.
There is a nice article on text rendering at http://www.antigrain.com/research/font_rasterization/index.h...
(I write "attempts" because the rules are complicated: http://neugierig.org/software/chromium/fonts/ )
I checked on my iPhone 4S and when I zoom in I can see a difference (that I might be missing on my desktop). It is incredibly subtle.
Fired up web inspector and I was surprised to find they use body {-webkit-font-smoothing: antialiased;}
defaults -currentHost write -globalDomain AppleFontSmoothing -int 2
To fix it.Randomly, I happen to have a picture of the subpixels on a Macbook Pro display. http://cl.ly/1D034736323N2f29191c/o