ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtfont.C
(Generate patch)

Comparing rxvt-unicode/src/rxvtfont.C (file contents):
Revision 1.80 by root, Mon Jan 9 07:17:24 2006 UTC vs.
Revision 1.81 by root, Mon Jan 9 07:19:18 2006 UTC

1271 const text_t *text, int len, 1271 const text_t *text, int len,
1272 int fg, int bg) 1272 int fg, int bg)
1273{ 1273{
1274 clear_rect (d, x, y, r->fwidth * len, r->fheight, bg); 1274 clear_rect (d, x, y, r->fwidth * len, r->fheight, bg);
1275 1275
1276 int base = ascent; // should be fbase, but that is incorrect
1277
1278 XGlyphInfo extents; 1276 XGlyphInfo extents;
1279 XftGlyphSpec *enc = (XftGlyphSpec *) get_enc_buf (len * sizeof (XftGlyphSpec)); 1277 XftGlyphSpec *enc = (XftGlyphSpec *) get_enc_buf (len * sizeof (XftGlyphSpec));
1280 XftGlyphSpec *ep = enc; 1278 XftGlyphSpec *ep = enc;
1281 1279
1282 // skip trailing spaces 1280 // cut trailing spaces
1283 while (len && text [len - 1] == ' ') 1281 while (len && text [len - 1] == ' ')
1284 len--; 1282 len--;
1285 1283
1286 while (len) 1284 while (len)
1287 { 1285 {
1296 FT_UInt gl = XftCharIndex (d.display->display, f, fc); 1294 FT_UInt gl = XftCharIndex (d.display->display, f, fc);
1297 XftGlyphExtents (d.display->display, f, &gl, 1, &extents); 1295 XftGlyphExtents (d.display->display, f, &gl, 1, &extents);
1298 1296
1299 ep->glyph = gl; 1297 ep->glyph = gl;
1300 ep->x = x + (cwidth - extents.xOff >> 1); 1298 ep->x = x + (cwidth - extents.xOff >> 1);
1301 ep->y = y + base; 1299 ep->y = y + ascent;
1302 ep++; 1300 ep++;
1303 } 1301 }
1304 1302
1305 x += cwidth; 1303 x += cwidth;
1306 } 1304 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines