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 | |
888 | bool |
884 | bool |
889 | rxvt_font_xft::has_codepoint (uint32_t unicode) |
885 | rxvt_font_xft::has_codepoint (uint32_t unicode) |
… | |
… | |
894 | void |
890 | void |
895 | rxvt_font_xft::draw (int x, int y, |
891 | rxvt_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 | |