… | |
… | |
760 | }; |
760 | }; |
761 | |
761 | |
762 | void |
762 | void |
763 | rxvt_font_xft::clear () |
763 | rxvt_font_xft::clear () |
764 | { |
764 | { |
|
|
765 | if (d) |
|
|
766 | { |
|
|
767 | XftDrawDestroy (d); |
|
|
768 | d = 0; |
|
|
769 | } |
|
|
770 | |
765 | if (f) |
771 | if (f) |
766 | { |
772 | { |
767 | XftFontClose (DISPLAY, f); |
773 | XftFontClose (DISPLAY, f); |
768 | f = 0; |
774 | f = 0; |
769 | } |
|
|
770 | |
|
|
771 | if (d) |
|
|
772 | { |
|
|
773 | XftDrawDestroy (d); |
|
|
774 | d = 0; |
|
|
775 | } |
775 | } |
776 | } |
776 | } |
777 | |
777 | |
778 | rxvt_fontprop |
778 | rxvt_fontprop |
779 | rxvt_font_xft::properties () |
779 | rxvt_font_xft::properties () |
… | |
… | |
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 | |
881 | return true; |
885 | return true; |
882 | } |
886 | } |
883 | |
887 | |
884 | bool |
888 | bool |
885 | rxvt_font_xft::has_codepoint (uint32_t unicode) |
889 | rxvt_font_xft::has_codepoint (uint32_t unicode) |
… | |
… | |
890 | void |
894 | void |
891 | rxvt_font_xft::draw (int x, int y, |
895 | rxvt_font_xft::draw (int x, int y, |
892 | const text_t *text, int len, |
896 | const text_t *text, int len, |
893 | int fg, int bg) |
897 | int fg, int bg) |
894 | { |
898 | { |
895 | if (!d) |
|
|
896 | d = XftDrawCreate (DISPLAY, DRAWABLE, r->display->visual, r->display->cmap); |
|
|
897 | |
|
|
898 | if (bg >= 0 && bg != Color_bg) |
899 | if (bg >= 0 && bg != Color_bg) |
899 | XftDrawRect (d, &r->PixColors[bg].c, x, y, r->TermWin.fwidth * len, r->TermWin.fheight); |
900 | XftDrawRect (d, &r->PixColors[bg].c, x, y, r->TermWin.fwidth * len, r->TermWin.fheight); |
900 | else |
901 | else |
901 | clear_rect (x, y, r->TermWin.fwidth * len, r->TermWin.fheight, bg); |
902 | clear_rect (x, y, r->TermWin.fwidth * len, r->TermWin.fheight, bg); |
902 | |
903 | |