emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incorrect font weight selected


From: Yuri D'Elia
Subject: Re: Incorrect font weight selected
Date: Mon, 20 Dec 2021 00:24:20 +0100
User-agent: mu4e 1.7.5; emacs 29.0.50

On Fri, Dec 17 2021, Yuri D'Elia wrote:
> When I start emacs with --daemon and then create a new frame via
> emacsclient, the 'regular weight is used for the new frame instead.
>
> This is new. Until the build from ~4 days ago, 'medium was selected
> correctly in both cases. In both cases, the correct font family and size
> is used: only the weight is incorrect.
>
> When I revert commit 1b2511fa2aed460120a36765ba16c14e355eef1d then the
> 'medium weight is selected correctly in both scenarios.

After debugging a little bit on this, I came up with a relatively short
test to reproduce the issue.

Consider the following test.el:

  (set-face-attribute 'default nil :family "Iosevka SS08" :height 140 :weight 
'bold)
  (make-frame)

started with emacs -q -l test.el.

This starts emacs, sets the default face with the iosevka family with
bold, then creates a second frame. The original frame is at the top. The
second frame at the bottom. master.png following:

PNG image

Notice how I'm using "bold" now, but the resulting face in the new frame
is still just regular. Turns out medium has nothing to do with this.

Now with commit 1b2511fa2aed460120a36765ba16c14e355eef1d reverted
(reverted.png following):

PNG image

Note how both frames are now bold. Please note the mode-line face as
well. I'm not changing the face there. The incorrect weight selection is
also affecting the face there.

Indeed, it seems that any font weight which is within "100" in the
weight table can be susceptible to bad selection. Commit
1b2511fa2aed460120a36765ba16c14e355eef1d by itself makes sense. We
likely have a problem elsewhere.

Maybe font_sort_entities is not sorting the matches correctly by weight,
or we are calling it wrong in some places.

Cannot go further at the moment.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]