[cairo] trouble with Cairo text in OpenGL

Victor henri nadaeck at hotmail.com
Thu Jan 5 04:54:48 PST 2012

Hello Andrea

Well thanks to your help, it works now!

> Kind of, he needs to flush the drawing operations with cairo_surface_flush().
> http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-flush

Indeed a proper call to 'cairo_surface_flush(surface)' before calling 'cairo_image_surface_get_data (surface)' ws necessary

> You're trying to draw a very big text string on a very small image.
> I would suggest you to start using a big destination and a default font.

I had to adjust a bit but this was quite ok

> Saving to png can help you check if the image content is what you need it to be.
> For this kind of debugging purposes, cairo provides cairo_surface_write_to_png()
> http://cairographics.org/manual/cairo-PNG-Support.html#cairo-surface-write-to-png

This was not necessary hopefully 

> This is basically the same as (the cairo part of) your code, except
> that it starts the text from (0,48), making it visible.
> (If you define FIXED to 0, you get a completely transparent image).

Yes I had to call cairo_move_to() to have the text at the right place;

> If you manage to get the png right, making cairo and GL interact as
> desired should only be a matter of choosing the correct pixel format.
> Andrea

Many stuff have already been said yesterday; thank you to all of you who helped me so kindly

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120105/05e54eb4/attachment.htm>

More information about the cairo mailing list