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

Comparing rxvt-unicode/src/defaultfont.C (file contents):
Revision 1.49 by pcg, Mon Mar 22 15:15:04 2004 UTC vs.
Revision 1.51 by pcg, Fri Apr 2 00:51:09 2004 UTC

729 729
730 int base = r->TermWin.fbase; 730 int base = r->TermWin.fbase;
731 731
732 XGCValues v; 732 XGCValues v;
733 v.foreground = r->PixColors[fg]; 733 v.foreground = r->PixColors[fg];
734 v.background = r->PixColors[bg];
735 v.font = f->fid; 734 v.font = f->fid;
736 735
737 if (enc2b) 736 if (enc2b)
738 { 737 {
739 const XChar2b *xc = enc_xchar2b (text, len, cs, slow); 738 const XChar2b *xc = enc_xchar2b (text, len, cs, slow);
740 739
741 if (bg == Color_bg && !slow) 740 if (bg == Color_bg && !slow)
742 { 741 {
742 v.background = r->PixColors[bg];
743 XChangeGC (d.display->display, TGC, GCForeground | GCBackground | GCFont, &v); 743 XChangeGC (d.display->display, TGC, GCForeground | GCBackground | GCFont, &v);
744 XDrawImageString16 (d.display->display, d, TGC, x, y + base, xc, len); 744 XDrawImageString16 (d.display->display, d, TGC, x, y + base, xc, len);
745 } 745 }
746 else 746 else
747 { 747 {
769 { 769 {
770 const char *xc = enc_char (text, len, cs, slow); 770 const char *xc = enc_char (text, len, cs, slow);
771 771
772 if (bg == Color_bg && !slow) 772 if (bg == Color_bg && !slow)
773 { 773 {
774 v.background = r->PixColors[bg];
774 XChangeGC (d.display->display, TGC, GCForeground | GCBackground | GCFont, &v); 775 XChangeGC (d.display->display, TGC, GCForeground | GCBackground | GCFont, &v);
775 XDrawImageString (d.display->display, d, TGC, x, y + base, xc, len); 776 XDrawImageString (d.display->display, d, TGC, x, y + base, xc, len);
776 } 777 }
777 else 778 else
778 { 779 {
997#endif 998#endif
998 999
999///////////////////////////////////////////////////////////////////////////// 1000/////////////////////////////////////////////////////////////////////////////
1000 1001
1001rxvt_fontset::rxvt_fontset (rxvt_t r) 1002rxvt_fontset::rxvt_fontset (rxvt_t r)
1002: r (r) 1003: r (r), fontdesc (0)
1003{ 1004{
1004 clear (); 1005 clear ();
1005} 1006}
1006 1007
1007rxvt_fontset::~rxvt_fontset () 1008rxvt_fontset::~rxvt_fontset ()
1012void 1013void
1013rxvt_fontset::clear () 1014rxvt_fontset::clear ()
1014{ 1015{
1015 for (rxvt_font **i = fonts.begin (); i != fonts.end (); i++) 1016 for (rxvt_font **i = fonts.begin (); i != fonts.end (); i++)
1016 FONT_UNREF (*i); 1017 FONT_UNREF (*i);
1018
1019 free (fontdesc); fontdesc = 0;
1017 1020
1018 fonts.clear (); 1021 fonts.clear ();
1019 base_id = 0; 1022 base_id = 0;
1020 base_prop.height = 0x7fffffff; 1023 base_prop.height = 0x7fffffff;
1021 base_prop.weight = rxvt_fontprop::medium; 1024 base_prop.weight = rxvt_fontprop::medium;
1129bool 1132bool
1130rxvt_fontset::populate (const char *desc) 1133rxvt_fontset::populate (const char *desc)
1131{ 1134{
1132 clear (); 1135 clear ();
1133 1136
1137 fontdesc = strdup (desc);
1138
1134 fonts.push_back (new_font (0, CS_UNICODE)); 1139 fonts.push_back (new_font (0, CS_UNICODE));
1135 realize_font (0); 1140 realize_font (0);
1136 1141
1137 add_fonts (desc); 1142 add_fonts (desc);
1138 1143

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines