[cairo] Alpha channel for text under win32

Owen Taylor otaylor at redhat.com
Thu Apr 14 05:56:46 PDT 2005


On Thu, 2005-04-14 at 12:51 +1000, Jason Thomas wrote:
> 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.

Maybe I'm just misunderstood you. 

> 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

A RGB24 drawable has no alpha channel. What's in the 4 byte is
completely arbitrary.

> 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.

Why should the code be complicated and slowed down to fill in a
meaningless byte in some particular fashion.

> 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.

The text quality problem affects image surfaces too.

						Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050414/bc4f5b5c/attachment.pgp


More information about the cairo mailing list