unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 59347@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#59347: 29.0.50; `:family` face setting ignored
Date: Tue, 22 Nov 2022 20:52:42 +0000	[thread overview]
Message-ID: <0d1ea3007f1d7523338e@heytings.org> (raw)
In-Reply-To: <834juq28as.fsf@gnu.org>


>
> So let me go back to your scenario and ask you: what exactly is the 
> problem with the scenario that you described?  A reminder:
>
> 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
>
> Is the problem that you expected the family to be DejaVu Sans, but you 
> got a different family in some cases?
>
> Or is the problem that you expected a variable-pitch font, but got a 
> monospaced font in some cases?
>
> Or is the problem something else?
>

The problem is that users expect a variable pitch font for the 
variable-pitch face (and an antialiased font when antialising is on). 
That's what the "family = Sans Serif" specification of that face means.

>
> And why is this result:
>
> - 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
>
> better?
>

It is better because the "family = Sans Serif" specification of the 
variable-pitch face is obeyed.  (Incidentally, that result corresponds to 
the result returned by fc-match for those weights.)

>
> You asked for ultra-heavy and heavy weight, but got bold -- why is that 
> TRT?
>

Same answer: it is TRT because the "family = Sans Serif" specification of 
the variable-pitch face is obeyed.

>> Nothing tells it to reject fixed-pitch fonts as a last resort indeed. 
>> But clearly the code should not select a fixed-pitch font _because_ it 
>> is the only available font that supports say a 'semi-bold' weight, when 
>> variable pitch fonts that support a 'bold' weight are in fact 
>> available.
>
> Why is it "clear" that font selection should do what you expect here, 
> given that the only (weak) indication that we are after a variable-pitch 
> font is the family?  Why do you consider it so preposterous that Emacs 
> comes up with a semi-bold font, when you ask for a semi-bold font?
>

You seem to misunderstand how font selection works.  The "family = Sans 
Serif" specification of the variable-pitch face is not at at all a "weak" 
indication that we are after a variable pitch font, it's the strongest 
possible indication that we are after a variable pitch font.  It means 
"please choose whatever font you want among those installed on the system, 
but one in the Sans Serif family", "Sans Serif" being one of the few 
generic font families.  It's like the "Monospace" family for the default 
font.  It would be wrong if Emacs decided to select a variable pitch font 
for the default face, wouldn't it?

>> Of course the weight of the default face should influence the weight of 
>> all other faces.  But not to the point that a 'bold' variable pitch 
>> font is never even considered as a potential candidate for the 
>> variable-pitch face.
>
> How do you know it wasn't considered?
>

I debugged the code.

>
> And again, there's no information of any kind in the font-spec we use 
> that we are looking for a variable-pitch font.  We only have the family.
>

See above.

>
> Given that no font in the family matches the specified width, why 
> shouldn't Emacs try to find a font from another family that does match 
> the width?
>

Because the variable-pitch face is specified with "family = Sans Serif", 
and it is its only specification.  Specifying a font family means leaving 
a lot of freedom to the program (in this case Emacs, but the same applies 
to a browser for example) to select the font it wants among those 
installed on the system.  And there is no reason whatsoever to not obey 
that specification, unless there are strong reasons not to obey it (e.g. 
there are no Sans Serif fonts installed on the system, or the ones that 
are installed do not cover the character sets we want to display).  Which 
is evidently not the case here: if we're after a "Sans Serif semi-bold" 
font, and there are "Sans Serif bold" fonts installed on the system, they 
are good candidates.

There are, on my system, no less than 166 fonts in the "Sans Serif" 
family.  It just happens that none of them explicitly supports the 'heavy' 
weight / has no explicit 'heavy' variant.  But that is not a sufficient 
reason to reject all those 166 fonts.  What Emacs should do, what others 
programs do, and what Emacs would do with the patch, is to select the best 
possible font among those 166 fonts.

>
> Unfortunately, I've seen too many changes in this area which solved a 
> couple of problems, only to produce others, which took us time to 
> discover.  The last thing I want here is to do the same for the N+1st 
> time.  So let's first try to determine what exactly do we want to happen 
> and why.
>

I don't know what else I could say to convince you.





  reply	other threads:[~2022-11-22 20:52 UTC|newest]

Thread overview: 123+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  4:57 bug#59347: 29.0.50; `:family` face setting ignored Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-18 12:37 ` Eli Zaretskii
2022-11-18 14:59   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-18 15:13     ` Eli Zaretskii
2022-11-18 15:25       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-18 16:54         ` Eli Zaretskii
2022-11-18 17:21           ` Eli Zaretskii
2022-11-18 20:00             ` Yuan Fu
2022-11-18 20:12               ` Yuan Fu
2022-11-18 21:09                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-19  7:21                   ` Eli Zaretskii
2022-11-18 19:46           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-18 19:58             ` Eli Zaretskii
2022-11-18 20:55             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-19  7:15               ` Eli Zaretskii
2022-11-19 14:55                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-19 15:31                   ` Eli Zaretskii
2022-11-19 16:01                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-19 16:16                       ` Eli Zaretskii
2022-11-20 13:57                         ` Gregory Heytings
2022-11-20 14:59                           ` Eli Zaretskii
2022-11-20 15:35                             ` Gregory Heytings
2022-11-20 15:54                               ` Eli Zaretskii
2022-11-20 16:59                                 ` Gregory Heytings
2022-11-20 17:29                                   ` Eli Zaretskii
2022-11-20 17:43                                     ` Gregory Heytings
2022-11-20 17:58                                       ` Eli Zaretskii
2022-11-20 18:11                                         ` Gregory Heytings
2022-11-20 18:19                                           ` Eli Zaretskii
2022-11-20 19:45                                             ` Gregory Heytings
2022-11-20 20:01                                               ` Eli Zaretskii
2022-11-20 20:08                                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-20 20:45                                           ` Gregory Heytings
2022-11-21 12:27                                             ` Eli Zaretskii
2022-11-20 18:30                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-20 18:53                                           ` Eli Zaretskii
2022-11-20 18:31                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-20 18:54                                           ` Eli Zaretskii
2022-11-20 21:49                                         ` Gregory Heytings
2022-11-21 12:51                                           ` Eli Zaretskii
2022-11-21 14:48                                             ` Gregory Heytings
2022-11-21 15:08                                               ` Eli Zaretskii
2022-11-21 23:34                                                 ` Gregory Heytings
2022-11-22  0:34                                                   ` Gregory Heytings
2022-11-22  3:05                                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-22  7:59                                                       ` Gregory Heytings
2022-11-22 13:38                                                         ` Eli Zaretskii
2022-11-22 13:46                                                           ` Gregory Heytings
2022-11-22 13:16                                                       ` Eli Zaretskii
2022-11-22 13:38                                                         ` Gregory Heytings
2022-11-22 14:38                                                           ` Eli Zaretskii
2022-11-22 14:45                                                             ` Gregory Heytings
2022-11-22 14:53                                                               ` Eli Zaretskii
2022-11-22 15:41                                                                 ` Gregory Heytings
2022-11-22 17:44                                                                   ` Eli Zaretskii
2022-11-22 20:52                                                                     ` Gregory Heytings [this message]
2022-11-22 20:47                                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23  8:13                                                               ` Gregory Heytings
2022-11-30 10:03                                                                 ` Gregory Heytings
2022-11-30 14:00                                                                   ` Eli Zaretskii
2022-11-30 15:38                                                                     ` Gregory Heytings
2022-12-04 14:21                                                                       ` Eli Zaretskii
2022-12-05 23:30                                                                         ` Gregory Heytings
2022-12-06 14:22                                                                           ` Eli Zaretskii
2022-12-07 11:00                                                                             ` Gregory Heytings
     [not found]                                                                             ` <d99c6016-3b32-1116-9ef1-43fe40a71a4@heytings.org>
2022-12-07 11:02                                                                               ` Gregory Heytings
2022-12-07 23:19                                                                             ` Gregory Heytings
2022-12-08  0:27                                                                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-08  1:07                                                                                 ` Gregory Heytings
2022-12-08  8:16                                                                                   ` Eli Zaretskii
2022-12-08 14:59                                                                                     ` Gregory Heytings
2022-12-08 15:13                                                                                       ` Eli Zaretskii
     [not found]                                                                                     ` <e1b79bb2-a3c5-2677-57d8-fb6db43dfd9@heytings.org>
2022-12-08 16:27                                                                                       ` Gregory Heytings
2022-12-08 14:12                                                                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-08 15:33                                                                                     ` Gregory Heytings
2022-12-08 17:29                                                                                     ` Drew Adams
2022-12-08 17:44                                                                                       ` Eli Zaretskii
2022-12-08  5:32                                                                                 ` Yuan Fu
2022-12-08  8:09                                                                                 ` Eli Zaretskii
2022-12-08 14:17                                                                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-08 14:49                                                                                     ` Eli Zaretskii
2022-12-08 15:24                                                                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-08 15:45                                                                                         ` Eli Zaretskii
2022-12-08  8:03                                                                               ` Eli Zaretskii
2022-12-08 12:53                                                                                 ` Gregory Heytings
2022-12-08 14:16                                                                                   ` Eli Zaretskii
2022-12-08 15:17                                                                                     ` Gregory Heytings
2022-12-08 15:42                                                                                       ` Eli Zaretskii
2022-12-10 22:51                                                                                         ` Gregory Heytings
2022-12-12  0:57                                                                                           ` Gregory Heytings
2022-12-12  1:49                                                                                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-12  8:54                                                                                               ` Gregory Heytings
2022-12-12 10:33                                                                                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-12 10:51                                                                                                   ` Gregory Heytings
2022-12-12 11:18                                                                                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-12 11:38                                                                                                       ` Gregory Heytings
2022-12-12 12:47                                                                                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-12 15:30                                                                                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-12 15:45                                                                                                 ` Eli Zaretskii
2022-12-12 15:07                                                                                             ` Eli Zaretskii
2022-12-12 16:12                                                                                               ` Gregory Heytings
2022-12-12 17:10                                                                                                 ` Eli Zaretskii
2022-12-12 21:28                                                                                                   ` Gregory Heytings
2022-12-13 11:58                                                                                                     ` Eli Zaretskii
2022-12-13  1:16                                                                                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-13 15:40                                                                                                 ` Eli Zaretskii
2022-12-04 14:23                                                                 ` Eli Zaretskii
2022-11-22  6:42                                                     ` Gregory Heytings
2022-11-22  8:01                                                       ` Gregory Heytings
2022-11-22 13:27                                                       ` Eli Zaretskii
2022-11-22 12:38                                                   ` Eli Zaretskii
2022-11-22 12:43                                                     ` Gregory Heytings
2022-11-22 14:29                                                   ` Eli Zaretskii
2022-11-22 14:39                                                     ` Gregory Heytings
2022-11-22 14:52                                                       ` Eli Zaretskii
2022-11-22 15:17                                                         ` Gregory Heytings
2022-11-20 18:16                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-20 19:46                             ` Gregory Heytings
2022-11-19  0:20 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-19  0:28   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-19  4:37     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-19  6:01       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-19 14:17         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d1ea3007f1d7523338e@heytings.org \
    --to=gregory@heytings.org \
    --cc=59347@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).