rem: wwarning("error doing image processing:%s", RErrorString);
add: wwarning("error doing image processing:%s", RMessageForError(RErrorCode));
context: renderText(WMScreen *scr, char *text, char *font, RColor *from, RColor *to){    WMPixmap *wpix = NULL;    RImage *gradient = NULL;    Pixmap grad = None;    Pixmap mask = None;    RContext *rc = WMScreenRContext(scr);    XFontStruct *f = NULL;    int w, h;    GC gc = None;        f = XLoadQueryFont(dpy, font);    if (!f)	return NULL;    w = XTextWidth(f, text, strlen(text));    h = f->ascent+f->descent;    gradient = RRenderGradient(w, h, from, to, RVerticalGradient);    if (!gradient) {	wwarning("error doing image processing:%s", RErrorString);	goto bye;    }    if (!RConvertImage(rc, gradient, &grad)) {	wwarning("error doing image processing:%s", RErrorString);	goto bye;    }    mask = XCreatePixmap(dpy, rc->drawable, w, h, 1);    gc = XCreateGC(dpy, mask, 0, NULL);    XSetForeground(dpy, gc, rc->black);    XSetFont(dpy, gc, f->fid);    XFillRectangle(dpy, mask, gc, 0, 0, w, h);    XSetForeground(dpy, gc, rc->white);    XDrawString(dpy, mask, gc, 0, f->ascent, text, strlen(text));    XSetLineAttributes(dpy, gc, 3, LineSolid, CapRound, JoinMiter);        XDrawLine(dpy, mask, gc, 0, h-2, w, h-2);        wpix = WMCreatePixmapFromXPixmaps(scr, grad, mask, w, h, rc->depth); bye:    if (gc)	XFreeGC(dpy, gc);    XFreeFont(dpy, f);    if (gradient)	RDestroyImage(gradient);    return wpix;}