Sub-pixel antialiasing report #2 [GSoC]

Blog post by Andrej Spielmann on Wed, 2008-07-23 19:00

Another few weeks have passed since my last update, so here is another short report on the status of my project.
I hope everyone is enjoying the results of my work that have already been integrated into the main source trunk. Now I am pleased to announce that also the second part of my project is almost finished.

Sub-pixel antialiasing can now be used for all vector-graphics in Haiku. This includes not only most geometric shapes in the system, but also transformed (rotated, skewed…) and hinted text. For colour filtering, Stephan’s averaging method is used and the user can adjust the ratio between the weight of sub-pixel values and average values. If the last sentence doesn’t seem to make much sense to you, see this mailing list thread for details about the filtering method:

http://www.freelists.org/archives/haiku-development/07-2008/msg00093.html

The next thing I’m going to do is add the controls for sub-pixel antialiasing into the Appearance preferences applet (and thus remove them from the Fonts applet again). I have already done this partially, but my mentor Stephan thinks (and I do as well) that it would be better to rewrite the Appearance preflet completely and integrate a few other existing preflets into it. I’m not quite sure how much of this work he expects I will do myself, but I hope that I will have enough time to do most of it.

Finally, have a look at some pictures of my work in action. The left one is grayscale antialiasing and the right one is sub-pixel antialiasing. I’m giving out a free pint of beer to anyone who says they see a difference :-D

Comments

Re: Sub-pixel antialiasing report #2 [GSoC]

Difference: The black line under 'BPictureTest' mixes in properly with the red 'e' properly with sub-pixel antialiasing...

And it all looks great! Keep it up :)

Re: Sub-pixel antialiasing report #2 [GSoC]

ah I see, thanks to firefox 3 zoom.

Re: Sub-pixel antialiasing report #2 [GSoC]

Yes, the BPictureTest thing...

Besides that, I can still definitely see the differences in grayscale or subpixel AA - the "w" in "Swatches" for example is extremely obvious. The sub-pixel AA version is much cleaner looking on my LCD here. Also the lowercase "a" in "Antialiasing" looks clearer, and less muddy in the sub-pixel AA version.

Looks *very* good :)

Re: Sub-pixel antialiasing report #2 [GSoC]

Quote:

I’m giving out a free pint of beer to anyone who says they see a difference :-D

Alright... in picture A the time is 8:38, and in picture B it is 8:39. Besides, in the Appearance preflet, different methods appear selected in each image, and a BTextControl appears disabled in one of them.

Do I get my free beer? It was a pint per difference or a pint per post? :-)

Seriously now... thanks for your work!

Re: Sub-pixel antialiasing report #2 [GSoC]

I can't seem to get both hinting and sub pixel rendering to work, I uncommented the sub pixel rendering #define in the ../trunk/haiku/headers/libs/freetype2/freetype/config/ftoption.h and rebuild Haiku but text is still grayscale when I set Anti Aliasing type to LCD subpixel in Appearance. What am I doing wrong?

Still the hinting alone looks great.

Re: Sub-pixel antialiasing report #2 [GSoC]

IIRC, the subpixel rendering is not done in FT at all, but rather in the app_server backend where the compositing/alpha-blending takes place.

I could be wrong though.

Anyhow, isn't it just a setting in the Appearance prefs now?

Edit: I wasn't paying attention where you said you set it in the appearance :)

Re: Sub-pixel antialiasing report #2 [GSoC]

I'll repeat myself; I've set both hinting and LCD subpixel in Appearance, after I had uncommented the patented ClearType routine FT_CONFIG_OPTION_SUBPIXEL_RENDERING in the freetype config header http://svn.berlios.de/svnroot/repos/haiku/haiku/trunk/headers/libs/freetype2/fre etype/config/ftoption.h and rebuild Haiku. And it doesn't make any difference; text is still only grayscale, only when I set hinting to 'Off' do I see that LCD subpixel rendering is working like it should.

EDIT: got it working.

Re: Sub-pixel antialiasing report #2 [GSoC]

Are vectors drawn by fragment programs ?