[Xcb] xcb_image_text_8 Transparent Background

Aaron Plattner aplattner at nvidia.com
Sun Jan 2 00:40:35 PST 2011

On Sat, Jan 01, 2011 at 07:35:30PM -0800, Cinolt wrote:
> Hello, the xcb_image_text_8 function seems to fill the area of the text
> with the background color, and in my case it is black if not specified.
> Is there any way to prevent it from filling in a background color, and
> only draw the text? Here is a minimal example illustrating my problem, as
> this only displays a black box when I want to draw black text. Setting
> XCB_GC_FUNCTION to XCB_GX_CLEAR seems to have no effect.

I don't think ImageText8 is what you want, then (emphasis mine):

           drawable: DRAWABLE
           gc: GCONTEXT
           x, y: INT16
           string: STRING8

           Errors: Drawable, GContext, Match

           The x and y coordinates are relative to drawable's origin,
           and specify the baseline starting position (the initial
====>      character origin). The effect is to first fill a
====>      destination rectangle with the background pixel defined in
====>      gc, and then paint the text with the foreground pixel.
           The upper left corner of the filled rectangle is at
                   [x + overall-left, y - font-ascent]
           the width is
                   overall-right - overall-left
           and the height is
                   font-ascent + font-descent
           where overall-left, overall-right, font-ascent, and
           as font-descent are would be returned by a QueryTextExtents
           call using gc and string.

====>      The alu-function and fill-style defined in gc are ignored for
====>      this request; the effective alu-function is Copy and the
====>      effective fill-style Solid.

           For fonts defined with two-byte matrix indexing, each STRING8
           byte is interpreted as a byte2 value of a CHAR2B with a byte1
           value of zero.

           GC components: plane-mask, foreground, background, font,
           subwindow-mode, clip-x-origin, clip-y-origin, clip-mask

I think what you want is PolyText8.

-- Aaron

More information about the Xcb mailing list