unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuri D'Elia <wavexx@thregr.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Incorrect font weight selected
Date: Mon, 20 Dec 2021 00:24:20 +0100	[thread overview]
Message-ID: <87y24grwp6.fsf@wavexx.thregr.org> (raw)
In-Reply-To: <875yrmyk8q.fsf@wavexx.thregr.org>

[-- Attachment #1: Type: text/plain, Size: 964 bytes --]

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:


[-- Attachment #2: master.png --]
[-- Type: image/png, Size: 56090 bytes --]

[-- Attachment #3: Type: text/plain, Size: 237 bytes --]


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):


[-- Attachment #4: reverted.png --]
[-- Type: image/png, Size: 56766 bytes --]

[-- Attachment #5: Type: text/plain, Size: 550 bytes --]


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.

  parent reply	other threads:[~2021-12-19 23:24 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 14:51 Incorrect font weight selected Yuri D'Elia
2021-12-17 18:55 ` Eli Zaretskii
2021-12-17 19:47   ` Yuri D'Elia
2021-12-17 20:27     ` Eli Zaretskii
2021-12-17 21:25       ` Yuri D'Elia
2021-12-18  6:32         ` Eli Zaretskii
2021-12-18 10:43           ` Yuri D'Elia
2021-12-18 11:41             ` Eli Zaretskii
2021-12-18 12:00               ` Yuri D'Elia
2021-12-18 12:49                 ` Eli Zaretskii
2021-12-19 11:14                   ` Yuri D'Elia
2021-12-19 12:46                     ` Eli Zaretskii
2021-12-19 13:17                       ` Yuri D'Elia
2021-12-19 13:32                         ` Lars Ingebrigtsen
2021-12-19 23:24         ` Yuri D'Elia [this message]
2021-12-20 10:34           ` Lars Ingebrigtsen
2021-12-20 19:43             ` Stefan Monnier
2021-12-20 19:52               ` Eli Zaretskii
2021-12-20 20:14                 ` Stefan Monnier
2021-12-20 20:19                   ` Eli Zaretskii
2021-12-21  4:22                     ` Dmitry Gutov
2021-12-21 12:18                       ` Eli Zaretskii
2021-12-21 12:27                         ` Yuri D'Elia
2021-12-21 14:19                           ` Eli Zaretskii
2022-01-05 16:19                             ` Yuri D'Elia
2022-01-05 17:05                               ` Eli Zaretskii
2022-01-05 17:11                                 ` Yuri D'Elia
2022-01-05 18:04                                   ` Eli Zaretskii
2022-01-05 18:08                                     ` Yuri D'Elia
2022-01-05 19:07                                       ` Eli Zaretskii
2022-01-05 23:16                                         ` Yuri D'Elia
2022-01-06  7:09                                           ` Eli Zaretskii
2022-01-06  9:46                                             ` Yuri D'Elia
2022-01-06 12:22                                               ` Eli Zaretskii
2022-01-05 21:57                                       ` Dmitry Gutov
2022-01-05 23:15                                         ` Yuri D'Elia
2022-01-05 23:15                                         ` Yuri D'Elia
2022-01-06  5:15                                       ` Sean Whitton
2022-01-06  0:41                               ` Po Lu
2022-01-06  0:54                                 ` Po Lu
2022-01-06  9:49                                 ` Yuri D'Elia
2022-01-06 12:21                                   ` Eli Zaretskii
2021-12-21 13:52                       ` John ff
2021-12-20 20:05               ` Stefan Monnier
2021-12-20 15:16           ` Eli Zaretskii
2021-12-18 23:26 ` Sean Whitton
2021-12-19  6:44   ` Eli Zaretskii
2021-12-19 11:29     ` Yuri D'Elia
2021-12-19 12:52       ` Eli Zaretskii
2021-12-19 12:57         ` Yuri D'Elia
2021-12-19 13:32           ` Eli Zaretskii
2021-12-19 21:03         ` Sean Whitton
2021-12-19 22:04           ` Yuri D'Elia
2021-12-19 22:39             ` Sean Whitton
2021-12-20 21:59           ` Sean Whitton

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=87y24grwp6.fsf@wavexx.thregr.org \
    --to=wavexx@thregr.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).