After trying to use xcb_poly_text_8, I seem to be facing a similar problem as is described here: <a href="http://lists.freedesktop.org/archives/xcb/2007-January/002533.html" target="_blank">http://lists.freedesktop.org/archives/xcb/2007-January/002533.html</a><br>
<br>I define a structure:<br><br>struct<br> {<br> char *chars;<br> int nchars;<br> int delta;<br> xcb_font_t font;<br> } item;<br><br> item.chars = "Test";<br> item.nchars = 4;<br> item.delta = 0;<br>
item.font = 0;<br><br>and I call xcb_poly_text_8_checked:<br><br>cookie_text = xcb_poly_text_8_checked(c, w, gc, 16, 16, 1, (const uint8_t*)&item);<br>error = xcb_request_check(c, cookie_text);<br>printf("%d\n", (*error).error_code);<br>
xcb_flush(c);<br><br>and get the output 16, which in X11/X.h is defined
as BadLength. Are there any examples at all of a working implementation
of this function?<br><br><div class="gmail_quote">On Sun, Jan 2, 2011 at 3:40 AM, Aaron Plattner <span dir="ltr"><<a href="mailto:aplattner@nvidia.com">aplattner@nvidia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Sat, Jan 01, 2011 at 07:35:30PM -0800, Cinolt wrote:<br>
> Hello, the xcb_image_text_8 function seems to fill the area of the text<br>
> with the background color, and in my case it is black if not specified.<br>
> Is there any way to prevent it from filling in a background color, and<br>
> only draw the text? Here is a minimal example illustrating my problem, as<br>
> this only displays a black box when I want to draw black text. Setting<br>
> XCB_GC_FUNCTION to XCB_GX_CLEAR seems to have no effect.<br>
<br>
</div>I don't think ImageText8 is what you want, then (emphasis mine):<br>
<br>
ImageText8<br>
drawable: DRAWABLE<br>
gc: GCONTEXT<br>
x, y: INT16<br>
string: STRING8<br>
<br>
Errors: Drawable, GContext, Match<br>
<br>
The x and y coordinates are relative to drawable's origin,<br>
and specify the baseline starting position (the initial<br>
====> character origin). The effect is to first fill a<br>
====> destination rectangle with the background pixel defined in<br>
====> gc, and then paint the text with the foreground pixel.<br>
The upper left corner of the filled rectangle is at<br>
[x + overall-left, y - font-ascent]<br>
the width is<br>
overall-right - overall-left<br>
and the height is<br>
font-ascent + font-descent<br>
where overall-left, overall-right, font-ascent, and<br>
as font-descent are would be returned by a QueryTextExtents<br>
call using gc and string.<br>
<br>
====> The alu-function and fill-style defined in gc are ignored for<br>
====> this request; the effective alu-function is Copy and the<br>
====> effective fill-style Solid.<br>
<br>
For fonts defined with two-byte matrix indexing, each STRING8<br>
byte is interpreted as a byte2 value of a CHAR2B with a byte1<br>
value of zero.<br>
<br>
GC components: plane-mask, foreground, background, font,<br>
subwindow-mode, clip-x-origin, clip-y-origin, clip-mask<br>
<br>
I think what you want is PolyText8.<br>
<font color="#888888"><br>
-- Aaron<br>
</font></blockquote></div><br>