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.159 by sf-exg, Wed Mar 31 13:14:50 2010 UTC vs.
Revision 1.160 by sf-exg, Wed Mar 31 21:52:05 2010 UTC

482 482
483 x += fwidth; 483 x += fwidth;
484 } 484 }
485} 485}
486 486
487struct rxvt_font_meta : rxvt_font {
488 struct rxvt_fontset *fs;
489
490 rxvt_font_meta (rxvt_fontset *fs)
491 : rxvt_font ()
492 {
493 this->fs = fs;
494 }
495
496 rxvt_fontprop properties ()
497 {
498 rxvt_fontprop p;
499
500 p.width = p.height = 1;
501 p.ascent = rxvt_fontprop::unset;
502 p.weight = rxvt_fontprop::medium;
503 p.slant = rxvt_fontprop::roman;
504
505 return p;
506 }
507
508 bool load (const rxvt_fontprop &prop, bool force_prop)
509 {
510 width = 1; height = 1;
511 ascent = 1; descent = 0;
512
513 set_name (strdup ("built-in meta font"));
514
515 return true;
516 }
517
518 bool has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const
519 {
520 return false;
521 }
522
523 void draw (rxvt_drawable &d, int x, int y,
524 const text_t *text, int len,
525 int fg, int bg)
526 {
527 while (len--)
528 {
529 int fid = fs->find_font_idx (*text);
530 (*fs)[fid]->draw (d, x, y, text, 1, fg, bg);
531 ++text;
532 x += term->fwidth;
533 }
534 }
535};
536
487///////////////////////////////////////////////////////////////////////////// 537/////////////////////////////////////////////////////////////////////////////
488 538
489struct rxvt_font_x11 : rxvt_font { 539struct rxvt_font_x11 : rxvt_font {
490 rxvt_font_x11 () { f = 0; } 540 rxvt_font_x11 () { f = 0; }
491 541
1586 1636
1587 return -1; 1637 return -1;
1588} 1638}
1589 1639
1590int 1640int
1591rxvt_fontset::find_font (unicode_t unicode) 1641rxvt_fontset::find_font_idx (unicode_t unicode)
1592{ 1642{
1593 if (unicode >= 1<<20) 1643 if (unicode >= 1<<20)
1594 return 0; 1644 return 0;
1595 1645
1596 unicode_t hi = unicode >> 8; 1646 unicode_t hi = unicode >> 8;
1709 } 1759 }
1710 1760
1711 return i; 1761 return i;
1712} 1762}
1713 1763
1764int
1765rxvt_fontset::find_font (unicode_t unicode)
1766{
1767 int id = find_font_idx (unicode);
1768
1769 return min<int> (fontCount, id & 127) | (id & 128 ? Careful : 0);
1770}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines