diff options
| author | Eli Zaretskii | 2022-01-06 14:16:53 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2022-01-06 14:16:53 +0200 |
| commit | ca25fde951f906f6236875234e318b48a9feaa63 (patch) | |
| tree | 821cb8057b27492613a02e22c34c9a2afdfb4218 /src | |
| parent | cbe10f37533bc8dc21f7eb9a86bc5f31b3b2c884 (diff) | |
| download | emacs-ca25fde951f906f6236875234e318b48a9feaa63.tar.gz emacs-ca25fde951f906f6236875234e318b48a9feaa63.zip | |
Revert "Fix selection of fonts that don't have regular weight"
This reverts commit 1b2511fa2aed460120a36765ba16c14e355eef1d.
That commit caused unintended regressions which are worse
than the problem it attempted to fix. See the discussion at
https://lists.gnu.org/archive/html/emacs-devel/2021-12/msg01643.html
for the details.
Diffstat (limited to 'src')
| -rw-r--r-- | src/font.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/font.c b/src/font.c index 58ff1a7981b..266e5bc75c6 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -2768,6 +2768,7 @@ font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size) | |||
| 2768 | int candidate = XFIXNUM (AREF (entity, prop)) >> 8; | 2768 | int candidate = XFIXNUM (AREF (entity, prop)) >> 8; |
| 2769 | 2769 | ||
| 2770 | if (candidate != required | 2770 | if (candidate != required |
| 2771 | #ifdef HAVE_NTGUI | ||
| 2771 | /* A kludge for w32 font search, where listing a | 2772 | /* A kludge for w32 font search, where listing a |
| 2772 | family returns only 4 standard weights: regular, | 2773 | family returns only 4 standard weights: regular, |
| 2773 | italic, bold, bold-italic. For other values one | 2774 | italic, bold, bold-italic. For other values one |
| @@ -2777,14 +2778,10 @@ font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size) | |||
| 2777 | weight, so if we require exact match, the | 2778 | weight, so if we require exact match, the |
| 2778 | non-regular font will be rejected. So we relax | 2779 | non-regular font will be rejected. So we relax |
| 2779 | the accuracy of the match here, and let | 2780 | the accuracy of the match here, and let |
| 2780 | font_sort_entities find the best match. | 2781 | font_sort_entities find the best match. */ |
| 2781 | |||
| 2782 | Similar things happen on Posix platforms, when | ||
| 2783 | people use font families that don't have the | ||
| 2784 | regular weight, only the medium weight: these | ||
| 2785 | families get rejected if we require an exact match. */ | ||
| 2786 | && (prop != FONT_WEIGHT_INDEX | 2782 | && (prop != FONT_WEIGHT_INDEX |
| 2787 | || eabs (candidate - required) > 100) | 2783 | || eabs (candidate - required) > 100) |
| 2784 | #endif | ||
| 2788 | ) | 2785 | ) |
| 2789 | prop = FONT_SPEC_MAX; | 2786 | prop = FONT_SPEC_MAX; |
| 2790 | } | 2787 | } |