#include static char glyph_data[] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; int main() { Display *dpy = XOpenDisplay(NULL); XSetWindowAttributes attr; Window w; Picture pict; Picture grad; XLinearGradient gradient; XFixed stops[2]; XRenderColor colors[2]; GlyphSet glyphs; Glyph g = 0x43; XGlyphInfo ginfo; gradient.p1.x = 0; gradient.p1.y = 0; gradient.p2.x = 100 << 16; gradient.p2.y = 100 << 16; stops[0] = 0; stops[1] = 1 << 16; colors[0].red = colors[0].green = 0x8000; colors[0].blue = colors[0].alpha = 0xffff; colors[1].blue = colors[1].green = 0x8000; colors[1].red = colors[1].alpha = 0xffff; ginfo.width = 9; ginfo.height = 11; ginfo.x = 0; ginfo.y = 0; ginfo.xOff = 0; ginfo.yOff = 0; attr.override_redirect = True; attr.event_mask = ExposureMask; grad = XRenderCreateLinearGradient(dpy, &gradient, &stops[0], &colors[0], 2); glyphs = XRenderCreateGlyphSet(dpy, XRenderFindStandardFormat(dpy, PictStandardA8)); XRenderAddGlyphs(dpy, glyphs, &g, &ginfo, 1, glyph_data, sizeof(glyph_data)); w = XCreateWindow(dpy, DefaultRootWindow(dpy), 0, 0, 100, 100, 0, DefaultDepth(dpy, 0), InputOutput, DefaultVisual(dpy, 0), CWOverrideRedirect | CWEventMask, &attr); pict = XRenderCreatePicture(dpy, w, XRenderFindVisualFormat(dpy, DefaultVisual(dpy, 0)), 0, NULL); XMapWindow(dpy, w); while (True) { XEvent e; XNextEvent(dpy, &e); if (e.type == Expose) { XRenderComposite(dpy, PictOpSrc, grad, 0, pict, 0, 0, 0, 0, 0, 0, 100, 100); XRenderCompositeString8(dpy, PictOpSrc, grad, pict, NULL, glyphs, 30, 30, 30, 30, "C", 1); } } }