From: Kenichi Handa Date: Fri, 15 Aug 2003 12:08:51 +0000 (+0000) Subject: * xfaces.c (better_font_p): Prefer a real scalable font; i.e. not X-Git-Tag: ttn-vms-21-2-B4~9104 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=10b7e56f147cae42bdb5dce74e3eef8185dfe0f1;p=emacs.git * xfaces.c (better_font_p): Prefer a real scalable font; i.e. not what autoscaled. (best_matching_font): Once we find a better scalable font, set non_scalable_has_exact_height_p to 1. --- diff --git a/src/xfaces.c b/src/xfaces.c index e296c52a2b8..229797fc1ad 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6045,6 +6045,18 @@ better_font_p (values, font1, font2, compare_pt_p, avgwidth) return 1; } + if (! compare_pt_p) + { + /* We prefer a real scalable font; i.e. not what autoscaled. */ + int auto_scaled_1 = (font1->numeric[XLFD_POINT_SIZE] == 0 + && font1->numeric[XLFD_RESY] > 0); + int auto_scaled_2 = (font2->numeric[XLFD_POINT_SIZE] == 0 + && font2->numeric[XLFD_RESY] > 0); + + if (auto_scaled_1 != auto_scaled_2) + return auto_scaled_2; + } + return font1->registry_priority < font2->registry_priority; } @@ -6277,7 +6289,10 @@ best_matching_font (f, attrs, fonts, nfonts, width_ratio, needs_overstrike) || better_font_p (specified, fonts + i, best, 0, 0) || (!non_scalable_has_exact_height_p && !better_font_p (specified, best, fonts + i, 0, 0))) - best = fonts + i; + { + non_scalable_has_exact_height_p = 1; + best = fonts + i; + } } if (needs_overstrike)