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.70 by root, Tue Apr 26 00:35:00 2005 UTC vs.
Revision 1.71 by root, Sat Jun 18 10:02:35 2005 UTC

1254 1254
1255 XGlyphInfo extents; 1255 XGlyphInfo extents;
1256 FcChar32 *enc = (FcChar32 *) get_enc_buf (len * sizeof (FcChar32)); 1256 FcChar32 *enc = (FcChar32 *) get_enc_buf (len * sizeof (FcChar32));
1257 FcChar32 *ep = enc; 1257 FcChar32 *ep = enc;
1258 int ewidth = 0; 1258 int ewidth = 0;
1259 int xoff = 0;
1260 1259
1261 while (len) 1260 while (len)
1262 { 1261 {
1263 int cwidth = r->TermWin.fwidth; 1262 int cwidth = r->TermWin.fwidth;
1264 FcChar32 fc = *text++; len--; 1263 FcChar32 fc = *text++; len--;
1265 FT_UInt gl;
1266 1264
1267 while (len && *text == NOCHAR) 1265 while (len && *text == NOCHAR)
1268 text++, len--, cwidth += r->TermWin.fwidth; 1266 text++, len--, cwidth += r->TermWin.fwidth;
1269 1267
1270 gl = XftCharIndex (d.display->display, f, fc);
1271 XftGlyphExtents (d.display->display, f, &gl, 1, &extents);
1272
1273 if (extents.xOff != cwidth && ep != enc)
1274 {
1275 if (xoff > ewidth) xoff = ewidth;
1276 XftDrawGlyphs (d, &r->pix_colors[fg].c, f,
1277 x + (ewidth - xoff >> 1),
1278 y + base, enc, ep - enc);
1279 x += ewidth;
1280
1281 ep = enc;
1282 ewidth = 0;
1283 xoff = 0;
1284 }
1285
1286 if (fc == ' ' && ep == enc) // skip leading spaces 1268 if (fc == ' ' && ep == enc) // skip leading spaces
1287 {
1288 x += cwidth; 1269 x += cwidth;
1289 continue;
1290 }
1291
1292 else 1270 else
1293 { 1271 {
1272 FT_UInt gl = XftCharIndex (d.display->display, f, fc);
1273 XftGlyphExtents (d.display->display, f, &gl, 1, &extents);
1274
1275 if (extents.xOff != cwidth)
1276 {
1277 if (ewidth)
1278 {
1279 XftDrawGlyphs (d, &r->pix_colors[fg].c, f,
1280 x, y + base, enc, ep - enc);
1281 x += ewidth;
1282
1283 ep = enc;
1284 ewidth = 0;
1285 }
1286
1287 if (extents.xOff > cwidth)
1288 extents.xOff = cwidth;
1289
1290 XftDrawGlyphs (d, &r->pix_colors[fg].c, f,
1291 x + (cwidth - extents.xOff >> 1),
1292 y + base, &gl, 1);
1293 x += cwidth;
1294 }
1295 else
1296 {
1294 *ep++ = gl; 1297 *ep++ = gl;
1295 ewidth += cwidth; 1298 ewidth += cwidth;
1296 xoff += extents.xOff; 1299 }
1297 } 1300 }
1298 } 1301 }
1299 1302
1300 if (ep != enc) 1303 if (ep != enc)
1301 {
1302 if (xoff > ewidth) xoff = ewidth;
1303 XftDrawGlyphs (d, &r->pix_colors[fg].c, f, 1304 XftDrawGlyphs (d, &r->pix_colors[fg].c, f,
1304 x + (ewidth - xoff >> 1),
1305 y + base, enc, ep - enc); 1305 x, y + base, enc, ep - enc);
1306 }
1307} 1306}
1308#endif 1307#endif
1309 1308
1310///////////////////////////////////////////////////////////////////////////// 1309/////////////////////////////////////////////////////////////////////////////
1311 1310

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines