[cairo] Problem with text rendering on Win32+ClearType, and possible fix

Vladimir Vukicevic vladimir at pobox.com
Wed Oct 4 14:15:12 PDT 2006

----- Owen Taylor <otaylor at redhat.com> wrote:
> I can't say I'm that perfectly happy with the current state of 
> cairo-win32-surface.c. There's lots of confused comments, 
> #if 0'ed out code, etc. :-(

Yep, there's a number of things in there that didn't receive enough testing to turn on, but I didn't want to remove the code outright.  Things like using StretchDIBits and potentially StretchBlt fall into that category.  My testing is mostly with mozilla and the cairo test suite, along with a few one-off test programs, so it's certainly not extensive.  I've actually been at Microsoft the last few days, and I'm trying to get answers for some of the outstanding GDI questions that will have a direct effect on the win32 implementation.  So it's very much a work in progress, as I'm trying to squeeze out as much as I can out of GDI.

At this point though, it's looking like I might just get the damn thing into a working state and then leave it alone, and move on to working on a DirectX-backed surface, as that seems to be the way the world's going.  You're right about the DDB vs. DIB issues, by the way; I'll probably add some more explicit code in there to request DDBs, because we're seeing significant performance tradeoffs between different hardware.  On most modern hardware, "24-bit" DDBs are implemented as 32-bit xRGB; 24-bit DIBs are a disaster and need to be avoided at all costs (the thing that "breaks" is that pixman can't handle packed pixel, as far as I could tell, or something similar; the fact that CAIRO_FORMAT_RGB24 is defined to be 32-bits isn't really relevant, as nothing can access the data directly other than the surface itself).

In any case, the win32 surface stuff is actively being worked on, so it's bound to be a little messy in between releases especially with so few users.

    - Vlad

More information about the cairo mailing list