[Xcb] drawing a font

Vincent Torri Vincent.Torri at iecn.u-nancy.fr
Mon Dec 6 09:57:33 PST 2004



Hello,

On Mon, 6 Dec 2004, Jamey Sharp wrote:

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

no, i want to use xcb, and just for one reason: as i told you by mail, i'm
writing a tutorial. It remains some unclear points (the fonts, the mouse
cursor, and some few others). I've send you the tutorial, expecting some
ideas about that, but you didn't answer me.

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

maybe, i'll try. But not sure at all.

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

really ? I would have sent the request after any operation. But maybe i'm
wrong, i don't know the X protocol like you.

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

it's the remaining of an old test program about the event loop. But i
don't understand the memory leak, as XCBSync is supposed to clear the
buffer (as far as i've understood XSync).

Vincent TORRI


More information about the xcb mailing list