Google Summer of Code project: Sub-pixel anti-aliasing

Blog post by Andrej Spielmann on Wed, 2008-05-14 23:22

Hello Everybody!

My name is Andrej Spielmann and I am the GSoC student who will be implementing anti-aliasing based on LCD sub-pixels to Haiku’s graphics engine (App server, Painter, etc.).
Stephan Assmus is going to be my mentor on this project and Oliver Ruiz Dorantes seems to be my backup mentor and an eager investigator to the Slovak language and cuisine :-)

A short introduction of myself: I was born in Slovakia (Bratislava) and I still live there during vacations. During high school I have spent two years in Germany so I can speak German quite fine (Normally I would say very good but there are many Germans around :-). Now I’m studying at the University of Oxford (UK) at a 4-year undergraduate course in Mathematics & Computer Science. After I finish, I would like to go for a PhD somewhere else in Europe (Norway, Switzerland??) or in the USA. I very much like traveling, tourism, hiking and cooking. I’m most probably going to use a part of the GSoC money for a long trip around Russia including a part of the Trans-Siberian Railway.

I have no prior experience with coding for Haiku but I admire it a lot and will be very pleased to get involved with the community. Right now, I’m a little busy preparing for my exams, which take place between 2nd and 19th of June (but quite sparsely distributed, so there should be time for GSoC).
I am planning to start working on my project by the end of the next week, hopefully a couple of days before the official starting date to compensate for the time during exams when I won’t be able to fully concentrate on GSoC.

I will be coding on a Mac. I have set up all the compilation tools natively and now I’m able to build a hard disk image that runs in Parallels Desktop. If this turns out to be too slow or obstructing I will be considering other alternatives.
Right now the first big challenge for me will be to understand and get familiar with the existing Haiku code that I will be modifying. I will keep you updated on how it is going.

Bye,
Andrej

Contact:
ICQ: 161748133
Skype: andrejspielmann
e-mail: andrej.spielmann@seh.ox.ac.uk

Comments

Re: Google Summer of Code project: Sub-pixel anti-aliasing

Hi,
welcome to haiku :-)

Re: Google Summer of Code project: Sub-pixel anti-aliasing

Hi Andrej,

As a Cambridge PhD student obviously we're sworn enemies...but best of luck in your project anyway!

Sub-pixel rendering is very nice, especially the work Maxim Shemanarev of AGG fame did for sub-pixel positioning of text: http://www.antigrain.com/research/font_rasterization/ - if you could make his methods fast enough I think Haiku would have the nicest text rendering of any OS!

Simon

Re: Google Summer of Code project: Sub-pixel anti-aliasing

tangobravo wrote:

Sub-pixel rendering is very nice, especially the work Maxim Shemanarev of AGG fame did for sub-pixel positioning of text: http://www.antigrain.com/research/font_rasterization/ - if you could make his methods fast enough I think Haiku would have the nicest text rendering of any OS!

I too really like the work done by Maxim, but for some reason stippi doesn't (as far as I remember), so we may not see that in Haiku. But I sure hope we can push it into that direction and/or change stippi's mind. But since Andrej will be doing most of the work maybe we don't have to convince stippi ;)

Re: Google Summer of Code project: Sub-pixel anti-aliasing

Hmmm, what about AGG is not likeable, speed, lack of multithreadedness? I wonder what Stippi doesn't like about it, Stippi?

Re: Google Summer of Code project: Sub-pixel anti-aliasing

nutela wrote:

Hmmm, what about AGG is not likeable, speed, lack of multithreadedness? I wonder what Stippi doesn't like about it, Stippi?

It isn't AGG that stippi doesn't like, it was the method of sub-pixel font anti-aliasing demonstrated in that article that he did not like. At least that is what I recall, hopefully I am wrong or he has changed his mind.

Re: Google Summer of Code project: Sub-pixel anti-aliasing

No nazdar! Preji hodne stesti!

Stippi is a very nice guy, I am sure you will get along well.

Re: Google Summer of Code project: Sub-pixel anti-aliasing

[First of all: Welcome, Andrej!!]

Actually, I love everything about AGG, and it's not that I don't like the text placement method that Maxim developed, I just think it should not be the default for the entire graphical interface. The method described in the linked article is about the best trade-off between precise layout and crispness. However, text can be even more crisp if you don't need precise layout. You need it in a PDF viewer or a WYSIWYG document editor (though even there, the exact trade-offs are debatable). But you don't need it for the normal on-screen text rendering (user interface). This is the huge mistake that I believe MacOS-X is doing. And as a result, you have to live with blurry on screen text on a Mac with no way to fix it. On a screen, sharp text should be the priority, if for nothing else, then for health reasons. And indeed, working on a Mac strains your eyes more than any other OS (at least that's what my girlfriend and me feel).

In BeOS and Haiku, applications have the option to configure the desired text placement method (B_STRING_SPACING, B_BITMAP_SPACING, B_CHAR_SPACING). This is just a setting on BFont objects. In Haiku, this setting is currently ignored, but it should be easy to implement for example B_STRING_SPACING with the method that Maxim describes in his article while B_BITMAP_SPACING should be used for any normal interface text rendering.

Re: Google Summer of Code project: Sub-pixel anti-aliasing

@Stippi, thanks for the explenation, what about speed, is it really much slower? Would the GUI be more slugish if we'd used AGG exclusively for font rendering?

I must admit I really like reading cleartype rendered text, I don't have IE7 installed but on my wife's pc text reads very well eventough I use FF even on her pc (when I barrow it) just because I find MS SW annoying otherwise.

BTW I believe cleartype patents don't apply in the EU or non-US countries

Re: Google Summer of Code project: Sub-pixel anti-aliasing

Haiku already uses AGG for text rendering. There are two code paths, one where the text is used in vector form and rasterized by AGG (rotated or otherwise transformed text), and another code path where Freetype rendered bitmaps are used. The AGG rasterizer is based on the one from Freetype, so the results are visually the same. But even the pre-rendered bitmaps pass through AGG when they are composed onto the screen. There will be a speed impact when sub-pixel anti-aliasing is used, but considering that the current compositing implementation may not be ideal, it may well be that the overall speed can still be improved compared to what it is now. And the sub-pixel rendering has to be optional anyways, so it can be turned off on slower systems or when a CRT monitor is used.

Re: Google Summer of Code project: Sub-pixel anti-aliasing

Thanks, CRT monitors have the best anti-aliasing anyway, and it comes free of charge ;-)