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.152 by root, Sat Apr 4 21:27:53 2009 UTC vs.
Revision 1.155 by root, Tue Mar 30 23:00:35 2010 UTC

448 448
449 text_t chrs[2]; 449 text_t chrs[2];
450 chrs [1] = NOCHAR; 450 chrs [1] = NOCHAR;
451 451
452 *chrs = cc->c1; 452 *chrs = cc->c1;
453 rxvt_font *f1 = (*fs)[fs->find_font (cc->c1)]; 453 rxvt_font *f1 = fs->get (cc->c1);
454 f1->draw (d, x, y, chrs, width, fg, bg); 454 f1->draw (d, x, y, chrs, width, fg, bg);
455 455
456 if (cc->c2 != NOCHAR) 456 if (cc->c2 != NOCHAR)
457 { 457 {
458 bool careful; 458 bool careful;
459 459
460 // prefer font of first character, for no good reasons 460 // prefer font of first character, for no good reasons
461 *chrs = cc->c2; 461 *chrs = cc->c2;
462 rxvt_font *f2 = (f1->has_char (cc->c2, 0, careful) && !careful) 462 rxvt_font *f2 = (f1->has_char (cc->c2, 0, careful) && !careful)
463 ? f1 463 ? f1
464 : (*fs)[fs->find_font (cc->c2)]; 464 : fs->get (cc->c2);
465 465
466 f2->draw (d, x, y, chrs, width, fg, Color_none); 466 f2->draw (d, x, y, chrs, width, fg, Color_none);
467 } 467 }
468 } 468 }
469#endif 469#endif
1293rxvt_font_xft::draw (rxvt_drawable &d, int x, int y, 1293rxvt_font_xft::draw (rxvt_drawable &d, int x, int y,
1294 const text_t *text, int len, 1294 const text_t *text, int len,
1295 int fg, int bg) 1295 int fg, int bg)
1296{ 1296{
1297 XGlyphInfo extents; 1297 XGlyphInfo extents;
1298 XftGlyphSpec *enc = (XftGlyphSpec *)rxvt_temp_buf (len * sizeof (XftGlyphSpec)); 1298 XftGlyphSpec *enc = rxvt_temp_buf<XftGlyphSpec> (len);
1299 XftGlyphSpec *ep = enc; 1299 XftGlyphSpec *ep = enc;
1300 1300
1301 dTermDisplay; 1301 dTermDisplay;
1302 dTermGC; 1302 dTermGC;
1303 1303
1586 1586
1587 return -1; 1587 return -1;
1588} 1588}
1589 1589
1590int 1590int
1591rxvt_fontset::find_font (unicode_t unicode) 1591rxvt_fontset::find_font_ (unicode_t unicode)
1592{ 1592{
1593 if (unicode >= 1<<20) 1593 if (unicode >= 1<<20)
1594 return 0; 1594 return 0;
1595 1595
1596 unicode_t hi = unicode >> 8; 1596 unicode_t hi = unicode >> 8;
1675 FcPatternDestroy (match); 1675 FcPatternDestroy (match);
1676 1676
1677 if (find_font (font) < 0) 1677 if (find_font (font) < 0)
1678 { 1678 {
1679 char fontname[4096]; 1679 char fontname[4096];
1680 sprintf (fontname, "xft:%-.4090s", font); 1680 snprintf (fontname, sizeof (fontname), "xft:%s", font);
1681 1681
1682 fonts.push_back (new_font (fontname, CS_UNICODE)); 1682 fonts.push_back (new_font (fontname, CS_UNICODE));
1683 } 1683 }
1684 1684
1685 free (font); 1685 free (font);
1709 } 1709 }
1710 1710
1711 return i; 1711 return i;
1712} 1712}
1713 1713
1714int
1715rxvt_fontset::find_font (unicode_t unicode)
1716{
1717 return min<int> (fontCount, find_font_ (unicode));
1718}
1714 1719
1715 1720
1721

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines