Re: render texts to a buffer/drawable



Ronald Bultje <rbultje ronald bitfreak net> writes:
> Uhm... Never thought about that, really :-)
> Is there any way to get a 24-bit drawable form the server on
> non-24-bit X-servers?
> 
> Is it possible at all to have 24-bit drawables on non-24-bit
> X-servers?

Nope and nope. Server-side objects such as images and pixmaps are
raw-to-the-hardware. If the hardware lacks 24-bit mode you have no
24-bit available.

However as John points out, you could use a bitmap. All X servers
support 1-bit pixmaps (bitmaps).

> Or would I haev to use something else (client-side) for this? (like
> freetype, as John suggested).

That's a cleaner solution, yes.

> The problem I encountered with gdk_pixbuf_from_drawable is that it
> needed a colormap.

For 1-bit, you would call gdk_colormap_new() using a 1-bit visual
obtained with gdk_visual_get_best_with_depth(). 

Otherwise you need to know the colormap used to allocate the color you
used to render text to the pixmap.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]