… | |
… | |
195 | if (color == Color_bg) |
195 | if (color == Color_bg) |
196 | XClearArea (d.display->display, d, x, y, w, h, FALSE); |
196 | XClearArea (d.display->display, d, x, y, w, h, FALSE); |
197 | else if (color >= 0) |
197 | else if (color >= 0) |
198 | { |
198 | { |
199 | #if XFT |
199 | #if XFT |
200 | XftDrawRect (d, &r->PixColors[color].c, x, y, w, h); |
200 | XftDrawRect (d, &r->pix_colors[color].c, x, y, w, h); |
201 | #else |
201 | #else |
202 | XSetForeground (d.display->display, TGC, r->PixColors[color]); |
202 | XSetForeground (d.display->display, TGC, r->pix_colors[color]); |
203 | XFillRectangle (d.display->display, d, TGC, x, y, w, h); |
203 | XFillRectangle (d.display->display, d, TGC, x, y, w, h); |
204 | #endif |
204 | #endif |
205 | } |
205 | } |
206 | } |
206 | } |
207 | |
207 | |
… | |
… | |
266 | const text_t *text, int len, |
266 | const text_t *text, int len, |
267 | int fg, int bg) |
267 | int fg, int bg) |
268 | { |
268 | { |
269 | clear_rect (d, x, y, r->TermWin.fwidth * len, r->TermWin.fheight, bg); |
269 | clear_rect (d, x, y, r->TermWin.fwidth * len, r->TermWin.fheight, bg); |
270 | |
270 | |
271 | XSetForeground (d.display->display, TGC, r->PixColors[fg]); |
271 | XSetForeground (d.display->display, TGC, r->pix_colors[fg]); |
272 | |
272 | |
273 | while (len--) |
273 | while (len--) |
274 | { |
274 | { |
275 | #if ENABLE_COMBINING |
275 | #if ENABLE_COMBINING |
276 | compose_char *cc; |
276 | compose_char *cc; |
… | |
… | |
362 | f1->draw (d, x, y, &(t = cc->c1), 1, fg, bg); |
362 | f1->draw (d, x, y, &(t = cc->c1), 1, fg, bg); |
363 | if (cc->c2 != NOCHAR) |
363 | if (cc->c2 != NOCHAR) |
364 | { |
364 | { |
365 | // prefer font of first character, for no good reasons |
365 | // prefer font of first character, for no good reasons |
366 | rxvt_font *f2 = f1->has_codepoint (cc->c2) |
366 | rxvt_font *f2 = f1->has_codepoint (cc->c2) |
367 | ? f1 |
367 | ? f1 |
368 | : (*fs)[fs->find_font (cc->c2)]; |
368 | : (*fs)[fs->find_font (cc->c2)]; |
369 | |
369 | |
370 | f2->draw (d, x, y, &(t = cc->c2), 1, fg, -1); |
370 | f2->draw (d, x, y, &(t = cc->c2), 1, fg, -1); |
371 | } |
371 | } |
372 | } |
372 | } |
373 | #endif |
373 | #endif |
… | |
… | |
731 | || height != r->TermWin.fheight; |
731 | || height != r->TermWin.fheight; |
732 | |
732 | |
733 | int base = r->TermWin.fbase; |
733 | int base = r->TermWin.fbase; |
734 | |
734 | |
735 | XGCValues v; |
735 | XGCValues v; |
736 | v.foreground = r->PixColors[fg]; |
736 | v.foreground = r->pix_colors[fg]; |
737 | v.font = f->fid; |
737 | v.font = f->fid; |
738 | |
738 | |
739 | if (enc2b) |
739 | if (enc2b) |
740 | { |
740 | { |
741 | const XChar2b *xc = enc_xchar2b (text, len, cs, slow); |
741 | const XChar2b *xc = enc_xchar2b (text, len, cs, slow); |
742 | |
742 | |
743 | if (bg == Color_bg && !slow) |
743 | if (bg == Color_bg && !slow) |
744 | { |
744 | { |
745 | v.background = r->PixColors[bg]; |
745 | v.background = r->pix_colors[bg]; |
746 | XChangeGC (d.display->display, TGC, GCForeground | GCBackground | GCFont, &v); |
746 | XChangeGC (d.display->display, TGC, GCForeground | GCBackground | GCFont, &v); |
747 | XDrawImageString16 (d.display->display, d, TGC, x, y + base, xc, len); |
747 | XDrawImageString16 (d.display->display, d, TGC, x, y + base, xc, len); |
748 | } |
748 | } |
749 | else |
749 | else |
750 | { |
750 | { |
… | |
… | |
772 | { |
772 | { |
773 | const char *xc = enc_char (text, len, cs, slow); |
773 | const char *xc = enc_char (text, len, cs, slow); |
774 | |
774 | |
775 | if (bg == Color_bg && !slow) |
775 | if (bg == Color_bg && !slow) |
776 | { |
776 | { |
777 | v.background = r->PixColors[bg]; |
777 | v.background = r->pix_colors[bg]; |
778 | XChangeGC (d.display->display, TGC, GCForeground | GCBackground | GCFont, &v); |
778 | XChangeGC (d.display->display, TGC, GCForeground | GCBackground | GCFont, &v); |
779 | XDrawImageString (d.display->display, d, TGC, x, y + base, xc, len); |
779 | XDrawImageString (d.display->display, d, TGC, x, y + base, xc, len); |
780 | } |
780 | } |
781 | else |
781 | else |
782 | { |
782 | { |
… | |
… | |
967 | clear_rect (d, x, y, r->TermWin.fwidth * len, r->TermWin.fheight, bg); |
967 | clear_rect (d, x, y, r->TermWin.fwidth * len, r->TermWin.fheight, bg); |
968 | |
968 | |
969 | if (!slow && width == r->TermWin.fwidth && 0) |
969 | if (!slow && width == r->TermWin.fwidth && 0) |
970 | { |
970 | { |
971 | if (sizeof (text_t) == sizeof (FcChar16)) |
971 | if (sizeof (text_t) == sizeof (FcChar16)) |
972 | XftDrawString16 (d, &r->PixColors[fg].c, f, x, y + r->TermWin.fbase, (const FcChar16 *)text, len); |
972 | XftDrawString16 (d, &r->pix_colors[fg].c, f, x, y + r->TermWin.fbase, (const FcChar16 *)text, len); |
973 | else |
973 | else |
974 | XftDrawString32 (d, &r->PixColors[fg].c, f, x, y + r->TermWin.fbase, (const FcChar32 *)text, len); |
974 | XftDrawString32 (d, &r->pix_colors[fg].c, f, x, y + r->TermWin.fbase, (const FcChar32 *)text, len); |
975 | } |
975 | } |
976 | else |
976 | else |
977 | { |
977 | { |
978 | while (len) |
978 | while (len) |
979 | { |
979 | { |
… | |
… | |
985 | |
985 | |
986 | XGlyphInfo extents; |
986 | XGlyphInfo extents; |
987 | if (sizeof (text_t) == sizeof (FcChar16)) |
987 | if (sizeof (text_t) == sizeof (FcChar16)) |
988 | { |
988 | { |
989 | XftTextExtents16 (d.display->display, f, (const FcChar16 *)text, 1, &extents); |
989 | XftTextExtents16 (d.display->display, f, (const FcChar16 *)text, 1, &extents); |
990 | XftDrawString16 (d, &r->PixColors[fg].c, f, x + extents.x + (fwidth - extents.width) / 2, |
990 | XftDrawString16 (d, &r->pix_colors[fg].c, f, x + extents.x + (fwidth - extents.width) / 2, |
991 | y + r->TermWin.fbase, (const FcChar16 *)text, 1); |
991 | y + r->TermWin.fbase, (const FcChar16 *)text, 1); |
992 | } |
992 | } |
993 | else |
993 | else |
994 | { |
994 | { |
995 | XGlyphInfo extents; |
995 | XGlyphInfo extents; |
996 | XftTextExtents32 (d.display->display, f, (const FcChar32 *)text, 1, &extents); |
996 | XftTextExtents32 (d.display->display, f, (const FcChar32 *)text, 1, &extents); |
997 | XftDrawString32 (d, &r->PixColors[fg].c, f, x + extents.x + (fwidth - extents.width) / 2, |
997 | XftDrawString32 (d, &r->pix_colors[fg].c, f, x + extents.x + (fwidth - extents.width) / 2, |
998 | y + r->TermWin.fbase, (const FcChar32 *)text, 1); |
998 | y + r->TermWin.fbase, (const FcChar32 *)text, 1); |
999 | } |
999 | } |
1000 | } |
1000 | } |
1001 | |
1001 | |
1002 | x += r->TermWin.fwidth; |
1002 | x += r->TermWin.fwidth; |
… | |
… | |
1215 | { |
1215 | { |
1216 | // search through the fallback list |
1216 | // search through the fallback list |
1217 | fonts.push_back (new_font (fallback->name, fallback->cs)); |
1217 | fonts.push_back (new_font (fallback->name, fallback->cs)); |
1218 | fallback++; |
1218 | fallback++; |
1219 | } |
1219 | } |
1220 | else |
1220 | else if (!bold) |
1221 | { |
1221 | { |
1222 | // try to find a new font. |
1222 | // try to find a new font. |
1223 | // only xft currently supported, as there is no |
1223 | // only xft currently supported, as there is no |
1224 | // way to configure this and xft is easier to hack in, |
1224 | // way to configure this and xft is easier to hack in, |
1225 | // while x11 has more framework in place already. |
1225 | // while x11 has more framework in place already. |