[Xcb] drawing a font

Jamey Sharp jamey at minilop.net
Mon Dec 6 09:11:25 PST 2004


On Mon, Dec 06, 2004 at 09:19:40AM +0100, Vincent Torri wrote:
> Hello,

Hi!

> Easy question: how to draw a string with xcb ?? i've spent quite a lot of
> time trying to do that, without success.

Frankly, I'd use Cairo's toy font API for this. Core X drawing is a bit
of a pain, and Cairo is really nice. :-)

But Jeremy may well be right. If drawing a dot works in this code, it's
only because there was some chance it'd work no matter what you did. To
be certain, you really should wait for the expose event. (That's true in
Xlib too.)

I might believe your argument a little more if you did the XCBSync
*before* drawing anything, but not even that would really convince me.

Even if Jeremy and I are wrong, the answer to your question will
probably be in an X error, so you'll want an event loop that tells you
about any errors you receive.

You also want an event loop because you're configuring your window to
send you a bunch of different events, and then ignoring them, which is
much like a memory leak.

I hope something in there is helpful.

--Jamey


More information about the xcb mailing list