[haiku-development] Alternative implementation of subpixel rendering

  • From: Claudio Leite <leitec@xxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 24 Nov 2010 17:21:08 -0500

Hello everyone,

 Way back in 2007 I attempted to implement subpixel text rendering on
Haiku, but failed miserably due to lack of C++ and AGG experience.
More recently, I've built upon Maxim and Stephan's excellent work. My main
goal is to elegantly add an alternative to the average filter by using
the filter provided in recent versions of FreeType (2.3.0+). This is
what you see in recent versions of Ubuntu, among other systems. Having
some formal training in typography, I tend to be rather picky about the
way text looks onscreen, so about a year ago I crudely hacked in
support that produced these results:

 http://staticky.com/haiku_aa/

 (I tried to match up the windows positions as best I could, since
  I had to recompile to enable the filter.)

 That early version had no gamma correction, and there were a couple of
bugs you could see in the ftfil-nohint image. It's similar to what I
think was Maxim's original filter that's still in the source, except
it's softer and reduces color fringing to a very comfortable level.
Since then I've experimented with the filter in various forms and
separately implemented a gamma correction filter that could easily
be plugged into the source.

 I'm in the process of re-implementing what I did last year except
hopefully in a clean and modular manner such that it could be enabled or
disabled as desired at runtime if compiled in. I have also experimented
with using the filter for other uses. This could allow for the "holy
grail" of AA: having all scalable graphics from AGG rendered with
subpixel AA and this filter. My adaptation of the FT filter works on any
antialiased bitmap rendered at 3x horizontal resolution (which is
basically what the original does, but I've adapted it to work outside of
FreeType).

 Of course, this stuff is highly subjective depending on people's eyes,
monitors, preferences, etc., so making it easily switchable on/off is a
big design goal for me. Would the Haiku development team be interested
in such a patch, patent issues notwithstanding?

Thank you for your time.
-Claudio

Other related posts: