[cairo] Alpha channel for text under win32

Jason Thomas jason.thomas at onycha-blue.com
Wed Apr 13 19:51:46 PDT 2005


Hello,

> FreeType is not used by the Win32 backend.

Very much aware of this, was just illustrating a similar font rendering API
(compare TextOut) where rendering does not in itself may not generate alpha.

JT:
>> Does anyone know if pixmaps/surfaces under X suffer from the same
problem?
>> i.e. alpha for all primatives but Text?

OT:
>No, it's not an X problem. It's not really a cairo/win32 problem either,
>I believe, just a bug in your hacked version of Cairo... you'd need ot
>debug your _cairo_win32_scaled_font_show_glyphs().

I don't see how the alpha is a bug in my "hacked" version of cairo.

FYI:

Results on a RGB32 DIBSECTION placed in a DC and passed into cairo via
cairo_win32_surface_create, where alpha channel is the 4th byte of the RGB
bitmaps pixels.

A) Cairo
Cairo image format: RGB24
Alpha Channel Lines/Regions: yes
Alpha Channel Text: no

B) Cairo "hacked"
Cairo image format: ARGB32
Alpha Channel Lines/Regions: yes
Alpha Channel Text: yes

IMO,

In A) the alpha channel use seems to me, from outside the API, to be
inconsistant, both in the cairo image format and the support for alpha. If
there is no alpha fine, but to fill this channel with alpha for only some
primatives.

B) seems consistent to me. In regards to the text quality, I would look into
it further, but if you are not keen on the idea of allowing
cairo_win32_surface_create to have flexibility in its cairo image format
then there is not too much point.

Just trying to be helpful.

Thanks anyway,
Jason Thomas.







More information about the cairo mailing list