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.20 by pcg, Fri Feb 20 22:27:23 2004 UTC vs.
Revision 1.22 by pcg, Sat Feb 21 22:14:00 2004 UTC

1/*--------------------------------*-C-*---------------------------------*; 1/*--------------------------------*-C-*---------------------------------*;
2 * File: defaultfont.C 2 * File: defaultfont.C
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * Copyright (c) 2003 Marc Lehmann rxvt@plan9.de> 4 * Copyright (c) 2003-2004 Marc Lehmann <pcg@goof.com>
5 * - original version. 5 * - original version.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or 9 * the Free Software Foundation; either version 2 of the License, or
876 FT_Set_Pixel_Sizes (face, 0, ftheight = prop.height); 876 FT_Set_Pixel_Sizes (face, 0, ftheight = prop.height);
877 } 877 }
878 878
879 XftUnlockFace (f); 879 XftUnlockFace (f);
880 880
881 d = XftDrawCreate (DISPLAY, DRAWABLE, r->display->visual, r->display->cmap);
882 if (!d)
883 return false;
884
885 return true; 881 return true;
886} 882}
887 883
888bool 884bool
889rxvt_font_xft::has_codepoint (uint32_t unicode) 885rxvt_font_xft::has_codepoint (uint32_t unicode)
894void 890void
895rxvt_font_xft::draw (int x, int y, 891rxvt_font_xft::draw (int x, int y,
896 const text_t *text, int len, 892 const text_t *text, int len,
897 int fg, int bg) 893 int fg, int bg)
898{ 894{
895 d = XftDrawCreate (DISPLAY, DRAWABLE, r->display->visual, r->display->cmap);
896
899 if (bg >= 0 && bg != Color_bg) 897 if (bg >= 0 && bg != Color_bg)
900 XftDrawRect (d, &r->PixColors[bg].c, x, y, r->TermWin.fwidth * len, r->TermWin.fheight); 898 XftDrawRect (d, &r->PixColors[bg].c, x, y, r->TermWin.fwidth * len, r->TermWin.fheight);
901 else 899 else
902 clear_rect (x, y, r->TermWin.fwidth * len, r->TermWin.fheight, bg); 900 clear_rect (x, y, r->TermWin.fwidth * len, r->TermWin.fheight, bg);
903 901

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines