… | |
… | |
26 | |
26 | |
27 | #include <cstdlib> |
27 | #include <cstdlib> |
28 | |
28 | |
29 | #include <inttypes.h> |
29 | #include <inttypes.h> |
30 | |
30 | |
|
|
31 | #if XFT |
|
|
32 | # include <fontconfig/fontconfig.h> |
|
|
33 | #endif |
|
|
34 | |
31 | #define MAX_OVERLAP_ROMAN (8 + 2) // max. character width in 8ths of the base width |
35 | #define MAX_OVERLAP_ROMAN (8 + 2) // max. character width in 8ths of the base width |
32 | #define MAX_OVERLAP_ITALIC (8 + 3) // max. overlap for italic fonts |
36 | #define MAX_OVERLAP_ITALIC (8 + 3) // max. overlap for italic fonts |
33 | |
37 | |
34 | #define OVERLAP_OK(w,wcw,prop) ((w) <= ( \ |
38 | #define OVERLAP_OK(w,wcw,prop) ((w) <= ( \ |
35 | (prop)->slant >= rxvt_fontprop::italic \ |
39 | (prop)->slant >= rxvt_fontprop::italic \ |
36 | ? ((prop)->width * (wcw) * MAX_OVERLAP_ITALIC + 7) >> 3 \ |
40 | ? ((prop)->width * (wcw) * MAX_OVERLAP_ITALIC + 7) >> 3 \ |
37 | : ((prop)->width * (wcw) * MAX_OVERLAP_ROMAN + 7) >> 3 \ |
41 | : ((prop)->width * (wcw) * MAX_OVERLAP_ROMAN + 7) >> 3 \ |
38 | )) |
42 | )) |
39 | |
43 | |
40 | const struct rxvt_fallback_font { |
44 | static const struct rxvt_fallback_font { |
41 | codeset cs; |
45 | codeset cs; |
42 | const char *name; |
46 | const char *name; |
43 | } fallback_fonts[] = { |
47 | } fallback_fonts[] = { |
44 | { CS_ISO8859_1, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-1" }, |
48 | { CS_ISO8859_1, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-1" }, |
45 | { CS_ISO8859_15, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-15" }, |
49 | { CS_ISO8859_15, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-15" }, |
… | |
… | |
1403 | && (bg == Color_transparent || bg == Color_bg |
1407 | && (bg == Color_transparent || bg == Color_bg |
1404 | || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) |
1408 | || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) |
1405 | { |
1409 | { |
1406 | int src_x = x, src_y = y; |
1410 | int src_x = x, src_y = y; |
1407 | |
1411 | |
1408 | if (term->bgPixmap.is_parentOrigin ()) |
1412 | if (term->bgPixmap.flags & bgPixmap_t::isTransparent) |
1409 | { |
1413 | { |
1410 | src_x += term->window_vt_x; |
1414 | src_x += term->window_vt_x; |
1411 | src_y += term->window_vt_y; |
1415 | src_y += term->window_vt_y; |
1412 | } |
1416 | } |
1413 | |
1417 | |