[cairo] Sub-pixel rendering and image-in-memory backend

David Reveman c99drn at cs.umu.se
Thu Dec 2 15:25:58 PST 2004


On Thu, 2004-12-02 at 11:52 -0800, Ned Konz wrote:
> Hi all,
> 
> I'm still working on the Squeak bindings for libcairo.
> 
> I'd really like some better text handling, though; if I use Freetype/2 
> directly, I can get sub-pixel rendered and hinted glyphs (in vertical or 
> horizontal RGB or BGR formats).
> 
> However, I can't see a way to do this when using Cairo to render to an 
> in-memory bitmap. Which is what I'm doing, for cross-platform purposes and to 
> play well with other Squeak graphics (plus we already have fast BitBlt 
> routines).
> 
> Ideally, I'd think that I should be able to tell Cairo that the bitmap will be 
> used as output to something with a particular layout of sub-pixels, and it 
> would use that information to do the right thing for all rendering, not just 
> text.

I actually did some ugly hacks to get this working some time ago. I made
cairo generate traps at triple resolution and I made libpixman export
the RasterizeTrapezoid function and then some filtering and it worked
pretty well. Slow, but it looked nice. I think there's still some
screenshots left here:
http://www.cs.umu.se/~c99drn/pics/component-alpha-stuff/

-David




More information about the cairo mailing list