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.83 by root, Mon Jan 9 07:35:23 2006 UTC

1269void 1269void
1270rxvt_font_xft::draw (rxvt_drawable &d, int x, int y, 1270rxvt_font_xft::draw (rxvt_drawable &d, int x, int y,
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 XGlyphInfo extents;
1275 XftGlyphSpec *enc = (XftGlyphSpec *)get_enc_buf (len * sizeof (XftGlyphSpec));
1276 XftGlyphSpec *ep = enc;
1277
1274 clear_rect (d, x, y, r->fwidth * len, r->fheight, bg); 1278 clear_rect (d, x, y, r->fwidth * len, r->fheight, bg);
1275 1279
1276 int base = ascent; // should be fbase, but that is incorrect
1277
1278 XGlyphInfo extents;
1279 XftGlyphSpec *enc = (XftGlyphSpec *) get_enc_buf (len * sizeof (XftGlyphSpec));
1280 XftGlyphSpec *ep = enc;
1281
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 {
1291 while (len && *text == NOCHAR) 1289 while (len && *text == NOCHAR)
1292 text++, len--, cwidth += r->fwidth; 1290 text++, len--, cwidth += r->fwidth;
1293 1291
1294 if (fc != ' ') // skip spaces 1292 if (fc != ' ') // skip spaces
1295 { 1293 {
1296 FT_UInt gl = XftCharIndex (d.display->display, f, fc); 1294 FT_UInt glyph = XftCharIndex (d.display->display, f, fc);
1297 XftGlyphExtents (d.display->display, f, &gl, 1, &extents); 1295 XftGlyphExtents (d.display->display, f, &glyph, 1, &extents);
1298 1296
1299 ep->glyph = gl; 1297 ep->glyph = glyph;
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