--- rxvt-unicode/src/rxvtfont.C 2006/01/09 07:17:24 1.80 +++ rxvt-unicode/src/rxvtfont.C 2006/01/09 07:35:23 1.83 @@ -1271,15 +1271,13 @@ const text_t *text, int len, int fg, int bg) { - clear_rect (d, x, y, r->fwidth * len, r->fheight, bg); - - int base = ascent; // should be fbase, but that is incorrect - XGlyphInfo extents; - XftGlyphSpec *enc = (XftGlyphSpec *) get_enc_buf (len * sizeof (XftGlyphSpec)); + XftGlyphSpec *enc = (XftGlyphSpec *)get_enc_buf (len * sizeof (XftGlyphSpec)); XftGlyphSpec *ep = enc; - // skip trailing spaces + clear_rect (d, x, y, r->fwidth * len, r->fheight, bg); + + // cut trailing spaces while (len && text [len - 1] == ' ') len--; @@ -1293,12 +1291,12 @@ if (fc != ' ') // skip spaces { - FT_UInt gl = XftCharIndex (d.display->display, f, fc); - XftGlyphExtents (d.display->display, f, &gl, 1, &extents); + FT_UInt glyph = XftCharIndex (d.display->display, f, fc); + XftGlyphExtents (d.display->display, f, &glyph, 1, &extents); - ep->glyph = gl; + ep->glyph = glyph; ep->x = x + (cwidth - extents.xOff >> 1); - ep->y = y + base; + ep->y = y + ascent; ep++; }