[haiku-development] Re: Text rendering

  • From: Claudio Leite <haiku@xxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 12 Jun 2007 15:08:05 -0400

* Stephan Assmus (superstippi@xxxxxx) wrote:
> So what do you need to do?
> You need to reimplement every DrawingMode for text. These special versions 
> will have to treat the alpha values from the scanlines as alpha versions 
> per subpixel (so triplets of alpha values). You need to apply filtering 
> (weighting!) or you will get colored glyph edges. See the agg mailing list 
> archive for the code for that (or libfreetype). Then you need to make 
> freetype render the glyph bitmaps with triple horizontal resolution for 
> non-transformed glyphs, as well as the rasterizer for transformed glyphs. 
> The first one is accomplished by changing agg_font_freetype, the second one 
> might be tricky because the rasterizer needs to be made to think the 
> available rendering buffer is two times larger in width.

First, thanks for the thorough introduction.

Let's assume I just do this for non-transformed glyphs. Freetype (as of
2.3.0) has a built-in LCD filter that looks great as far as I can tell.
According to freetype documentation, turning this on and rendering with
FT_RENDER_MODE_LCD returns the 3x bigger bitmap with R-G-B info. So, I
should be able to just implement the DrawingModes to make this work, right?

I see that AGG has a scanline32 class--would this be of any help?

Many thanks. I really want to understand this and make it work. One of
the reasons I got into BeOS in the 90's was due to AA'd fonts, but now
I'm used to OS X on LCD's so its AA looks poor in comparison. Of course
Haiku is better by default, but this'd just make it great.


Other related posts: