Subject: Re: bug#59347: 29.0.50; `:family` face setting ignored

From: Eli Zaretskii <[email-masked]>
Date: Sat, 19 Nov 2022 18:16:13 +0200

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked]
> Date: Sat, 19 Nov 2022 11:01:03 -0500
> 
> >> PS: Things become really weird with:
> >> 
> >>     src/emacs -Q --eval '(progn (custom-set-faces `(variable-pitch ((t
> >> (:family "DejaVu Sans" :foundry "*"))))) (add-to-list `default-frame-alist
> >> `(font . "-*-fixed-*-*-semicondensed-*-13-*-*-*-*-*-*-*"))
> >> (font-lock-mode -1) (insert (propertize "hello" `face `variable-pitch) "
> >> world"))'
> >> 
> >> where "hello" ends up with the following font:
> >> 
> >>     ftcrhb:-urw-Century Schoolbook L-medium-normal-normal-*-13-*-*-*-*-0-iso10646-1
> >
> > Why is this weird?
> 
> To me this font comes literally out of nowhere.

AFAIR, when we fail to find fonts that match the spec, we
progressively set more and more attributes to nil, so that in the end
we have all of them nil, and then the first font that matches the size
is fine.

> AFAICT the only relevant face specifications at play here are the two
> pieces of font-info in the recipe (and `face-font-family-alternatives`
> but this doesn't seem to play any role).

The other attributes come from the default face's font, I think.

> So, how do we end up with the `Century Schoolbook L` family (rather
> than either `fixed` or `DejaVu Sans` both of such seem just as
> qualified)?

I think if you step through the code, you will see it.