… | |
… | |
130 | { CS_UNICODE, "-*-lucidatypewriter-*-*-*-*-*-*-*-*-m-*-iso10646-1" }, |
130 | { CS_UNICODE, "-*-lucidatypewriter-*-*-*-*-*-*-*-*-m-*-iso10646-1" }, |
131 | { CS_UNICODE, "-*-unifont-*-*-*-*-*-*-*-*-c-*-iso10646-1" }, |
131 | { CS_UNICODE, "-*-unifont-*-*-*-*-*-*-*-*-c-*-iso10646-1" }, |
132 | { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1" }, |
132 | { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1" }, |
133 | { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1" }, |
133 | { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1" }, |
134 | #if XFT |
134 | #if XFT |
135 | { CS_UNICODE, "xft:Bitstream Vera Sans Mono:antialias=false:autohint=true"}, |
135 | { CS_UNICODE, "xft:Bitstream Vera Sans Mono:antialias=false:autohint=true" }, |
136 | { CS_UNICODE, "xft:Courier New:antialias=false:autohint=true" }, |
136 | { CS_UNICODE, "xft:Courier New:antialias=false:autohint=true" }, |
137 | { CS_UNICODE, "xft:Andale Mono:antialias=false" }, |
137 | { CS_UNICODE, "xft:Andale Mono:antialias=false:autohint=false" }, |
138 | { CS_UNICODE, "xft:Arial Unicode MS:antialias=false" }, |
138 | { CS_UNICODE, "xft:Arial Unicode MS:antialias=false:autohint=false" }, |
139 | |
139 | |
140 | // FreeMono is usually uglier than x fonts, so try last only. |
140 | // FreeMono is usually uglier than x fonts, so try last only. |
141 | { CS_UNICODE, "xft:FreeMono:autohint=true" }, |
141 | { CS_UNICODE, "xft:FreeMono:autohint=true" }, |
142 | #endif |
142 | #endif |
143 | |
143 | |
… | |
… | |
716 | |
716 | |
717 | int diff = 0; |
717 | int diff = 0; |
718 | |
718 | |
719 | if (replace_field (fname, list[i], 6, '0', field_str)) |
719 | if (replace_field (fname, list[i], 6, '0', field_str)) |
720 | diff += 10; // slightly penalize scalable fonts |
720 | diff += 10; // slightly penalize scalable fonts |
|
|
721 | else if (replace_field (fname, list[i], 11, '0', "0")) |
|
|
722 | diff += 300; // more heavily penalize what looks like scaled bitmap fotns |
721 | |
723 | |
722 | if (!set_properties (p, fname)) |
724 | if (!set_properties (p, fname)) |
723 | continue; |
725 | continue; |
724 | |
726 | |
725 | if (prop.height != rxvt_fontprop::unset |
727 | if (prop.height != rxvt_fontprop::unset |
… | |
… | |
741 | for (;;) |
743 | for (;;) |
742 | { |
744 | { |
743 | font_weight *best = fonts + count - 1; |
745 | font_weight *best = fonts + count - 1; |
744 | |
746 | |
745 | for (font_weight *w = best; w-- > fonts; ) |
747 | for (font_weight *w = best; w-- > fonts; ) |
746 | if (w->diff < best->diff) |
748 | if (w->diff <= best->diff) |
747 | best = w; |
749 | best = w; |
748 | |
750 | |
749 | if (!best->name |
751 | if (!best->name |
750 | || !(f = XLoadQueryFont (disp, best->name))) |
752 | || !(f = XLoadQueryFont (disp, best->name))) |
751 | break; |
753 | break; |
… | |
… | |
1096 | return false; |
1098 | return false; |
1097 | |
1099 | |
1098 | FcValue v; |
1100 | FcValue v; |
1099 | |
1101 | |
1100 | if (prop.height != rxvt_fontprop::unset |
1102 | if (prop.height != rxvt_fontprop::unset |
1101 | || (FcPatternGet (p, FC_PIXEL_SIZE, 0, &v) != FcResultMatch |
1103 | && (FcPatternGet (p, FC_PIXEL_SIZE, 0, &v) != FcResultMatch |
1102 | && FcPatternGet (p, FC_SIZE, 0, &v) != FcResultMatch)) |
1104 | && FcPatternGet (p, FC_SIZE, 0, &v) != FcResultMatch)) |
1103 | FcPatternAddInteger (p, FC_PIXEL_SIZE, prop.height); |
1105 | FcPatternAddInteger (p, FC_PIXEL_SIZE, prop.height); |
1104 | |
1106 | |
1105 | if (prop.weight != rxvt_fontprop::unset |
1107 | if (prop.weight != rxvt_fontprop::unset |
1106 | && FcPatternGet (p, FC_WEIGHT, 0, &v) != FcResultMatch) |
1108 | && FcPatternGet (p, FC_WEIGHT, 0, &v) != FcResultMatch) |
… | |
… | |
1381 | char buf[512]; |
1383 | char buf[512]; |
1382 | const char *end; |
1384 | const char *end; |
1383 | |
1385 | |
1384 | do |
1386 | do |
1385 | { |
1387 | { |
1386 | while (*desc <= ' ') desc++; |
1388 | while (*desc && *desc <= ' ') |
|
|
1389 | desc++; |
1387 | |
1390 | |
1388 | codeset cs = CS_UNICODE; |
1391 | codeset cs = CS_UNICODE; |
1389 | |
1392 | |
1390 | if (*desc == '[') |
1393 | if (*desc == '[') |
1391 | { |
1394 | { |