[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59347: 29.0.50; `:family` face setting ignored
From: |
Gregory Heytings |
Subject: |
bug#59347: 29.0.50; `:family` face setting ignored |
Date: |
Mon, 21 Nov 2022 23:34:18 +0000 |
I did some further testing to answer your previous email, and I now think
that my previous patch is a half-measure, and that TRT would be to simply
ignore the font weight specified in the default face while searching for
other fonts. Consider the following recipe:
emacs -Q
M-: (fancy-startup-screen) RET
and now evaluate the following lines in turn:
(set-face-attribute 'default nil :font "Source Code Pro" :weight 'ultra-heavy)
;; 1
(set-face-attribute 'default nil :font "Source Code Pro" :weight 'heavy) ;; 2
(set-face-attribute 'default nil :font "Source Code Pro" :weight 'ultra-bold)
;; 3
(set-face-attribute 'default nil :font "Source Code Pro" :weight 'bold) ;; 4
(set-face-attribute 'default nil :font "Source Code Pro" :weight 'semi-bold) ;;
5
(set-face-attribute 'default nil :font "Source Code Pro" :weight 'medium) ;; 6
(set-face-attribute 'default nil :font "Source Code Pro" :weight 'normal) ;; 7
(set-face-attribute 'default nil :font "Source Code Pro" :weight 'semi-light)
;; 8
(set-face-attribute 'default nil :font "Source Code Pro" :weight 'light) ;; 9
(set-face-attribute 'default nil :font "Source Code Pro" :weight 'ultra-light)
;; 10
(set-face-attribute 'default nil :font "Source Code Pro" :weight 'thin) ;; 11
(If you don't have the Source Code Pro font on your system, I'm sure you
can find another font with more weight variants with which you will
observe a similar effect.)
With current master, the variable-pitch face is realized as follows:
- with 1-3: -ADBO-Source Code
Pro-black-normal-normal-*-29-*-*-*-m-0-iso10646-1, which is a monospace font
- with 4: -PfEd-DejaVu Sans-bold-normal-normal-*-29-*-*-*-*-0-iso10646-1, which
is a variable pitch font
- with 5: -ADBO-Source Code
Pro-semibold-normal-normal-*-29-*-*-*-m-0-iso10646-1, which is again a
monospace font
- with 6: -urw-nimbus sans l-regular-r-normal--29-210-100-100-p-158-iso8859-1,
which is a variable pitch font but without anti-aliasing
- with 7: -PfEd-DejaVu Sans-regular-normal-normal-*-29-*-*-*-*-0-iso10646-1,
which is a variable pitch font
- with 8-9: -ADBO-Source Code
Pro-light-normal-normal-*-29-*-*-*-m-0-iso10646-1, which is again a monospace
font
- with 10-11: -PfEd-DejaVu
Sans-ultralight-normal-normal-*-29-*-*-*-*-0-iso10646-1, which is a variable
pitch font
That can't be right. Only 4, 7, and 10-11 correspond to what is expected
for that face, namely a variable pitch font. Fixing the 'medium' case (as
my patch does) only improves 7. Fixing the other cases would amount to do
something similar for each possible weight (e.g. "also try 'bold' after
trying 'ultra-bold'"), which in fact amounts to ignoring the weight in
spec.
When the weight is ignored in font_find_for_lface, the variable-pitch face
is realized as follows:
- with 1-5: -PfEd-DejaVu Sans-bold-normal-normal-*-29-*-*-*-*-0-iso10646-1
- with 6-7: -PfEd-DejaVu Sans-regular-normal-normal-*-29-*-*-*-*-0-iso10646-1
- with 8-11: -PfEd-DejaVu
Sans-ultralight-normal-normal-*-29-*-*-*-*-0-iso10646-1
Which is clearly TRT.
New patch attached.
Unset-the-weight-in-font-specs-when-searching-for-a-.patch
Description: Text Data
- bug#59347: 29.0.50; `:family` face setting ignored, (continued)
- bug#59347: 29.0.50; `:family` face setting ignored, Stefan Monnier, 2022/11/20
- bug#59347: 29.0.50; `:family` face setting ignored, Eli Zaretskii, 2022/11/20
- bug#59347: 29.0.50; `:family` face setting ignored, Stefan Monnier, 2022/11/20
- bug#59347: 29.0.50; `:family` face setting ignored, Eli Zaretskii, 2022/11/20
- bug#59347: 29.0.50; `:family` face setting ignored, Gregory Heytings, 2022/11/20
- bug#59347: 29.0.50; `:family` face setting ignored, Eli Zaretskii, 2022/11/21
- bug#59347: 29.0.50; `:family` face setting ignored, Gregory Heytings, 2022/11/21
- bug#59347: 29.0.50; `:family` face setting ignored, Eli Zaretskii, 2022/11/21
- bug#59347: 29.0.50; `:family` face setting ignored,
Gregory Heytings <=
- bug#59347: 29.0.50; `:family` face setting ignored, Gregory Heytings, 2022/11/21
- bug#59347: 29.0.50; `:family` face setting ignored, Stefan Monnier, 2022/11/21
- bug#59347: 29.0.50; `:family` face setting ignored, Gregory Heytings, 2022/11/22
- bug#59347: 29.0.50; `:family` face setting ignored, Eli Zaretskii, 2022/11/22
- bug#59347: 29.0.50; `:family` face setting ignored, Gregory Heytings, 2022/11/22
- bug#59347: 29.0.50; `:family` face setting ignored, Eli Zaretskii, 2022/11/22
- bug#59347: 29.0.50; `:family` face setting ignored, Gregory Heytings, 2022/11/22
- bug#59347: 29.0.50; `:family` face setting ignored, Eli Zaretskii, 2022/11/22
- bug#59347: 29.0.50; `:family` face setting ignored, Gregory Heytings, 2022/11/22
- bug#59347: 29.0.50; `:family` face setting ignored, Eli Zaretskii, 2022/11/22