diff options
author | Eli Zaretskii <eliz@gnu.org> | 2021-12-17 10:35:44 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2021-12-17 10:35:44 +0200 |
commit | 1b2511fa2aed460120a36765ba16c14e355eef1d (patch) | |
tree | 746559e50b37fe33312348fe753cc5b53a200a77 | |
parent | 78a86a4b32d020719c3be3469fd1a1379a26cfb3 (diff) | |
download | emacs-1b2511fa2aed460120a36765ba16c14e355eef1d.tar.gz |
Fix selection of fonts that don't have regular weight
* src/font.c (font_delete_unmatched): The kludge of allowing
inexact matches of the font weight is now used for non-NTGUI
platforms as well. (Bug#52493)
-rw-r--r-- | src/font.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/font.c b/src/font.c index d780d781f62..f934a8c0adc 100644 --- a/src/font.c +++ b/src/font.c @@ -2768,7 +2768,6 @@ font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size) int candidate = XFIXNUM (AREF (entity, prop)) >> 8; if (candidate != required -#ifdef HAVE_NTGUI /* A kludge for w32 font search, where listing a family returns only 4 standard weights: regular, italic, bold, bold-italic. For other values one @@ -2778,10 +2777,14 @@ font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size) weight, so if we require exact match, the non-regular font will be rejected. So we relax the accuracy of the match here, and let - font_sort_entities find the best match. */ + font_sort_entities find the best match. + + Similar things happen on Posix platforms, when + people use font families that don't have the + regular weight, only the medium weight: these + families get rejected if we require an exact match. */ && (prop != FONT_WEIGHT_INDEX || eabs (candidate - required) > 100) -#endif ) prop = FONT_SPEC_MAX; } |