Subject: bug#57555: 29.0.50; variable-pitch font issue with medium weight default font

From: Eli Zaretskii <[email-masked]>
Date: Sat, 03 Sep 2022 09:23:11 +0300

> From: Amin Bandali <[email-masked]>
> Date: Fri, 02 Sep 2022 21:35:24 -0400
> 
> As of the recent 6b1ed2f2c99a1c2da56c5f434570c438cad6576d, I've been
> experiencing an issue where Emacs chooses / falls back on 'misc-fixed'
> instead of the correct sans-serif variable-pitch font ('GNU FreeSans',
> for me) when I use a custom default font with medium weight.
> 
> Screenshots from before (no issue) and after (with issue) the commit:
> 
> https://kelar.org/~bandali/tmp/20220903/before-6b1ed2f.png
> https://kelar.org/~bandali/tmp/20220903/after-6b1ed2f.png
> 
> This happens regardless of whether I set the font via X resources:
> 
>     Emacs.font: Source Code Pro Medium-10.5
> 
> or with Emacs Lisp:
> 
>     (set-frame-font "Source Code Pro-10.5:weight=medium" nil t)
> 
> This happens only if I use the medium weight variant, and if I leave
> that out and just use Source Code Pro (regular) this doesn't happen.
> Also, perhaps strangely enough, the issue seems to only affect the
> regular variable-pitch font: e.g. italic variable-pitch is correctly
> displayed in sans-serif.

Thanks, but please show the font setup you are using; without that, the
"instead of the correct sans-serif variable-pitch font" part is
impossible to interpret.

Also, do you have the medium (not regular) variant of the GNU FreeSans
font installed?  If not, can you install it and try again?

What seems to happen here is that Emacs decides that the font you
don't like is a better match than the one you do like.  Which is not a
serious problem from my POV (as long as the text is legible), just a
minor aesthetic annoyance.  To fix such annoyances, one must tune
one's font configuration.  But even if the annoyance stays, it's
definitely less serious than the original problem which that commit
attempted to fix.

Thanks.