From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#59347: 29.0.50; `:family` face setting ignored Date: Sun, 20 Nov 2022 21:49:46 +0000 Message-ID: <7cc9e03786e324ff82ef@heytings.org> References: <83bkp4bfqf.fsf@gnu.org> <83wn7s9txp.fsf@gnu.org> <83pmdk9pat.fsf@gnu.org> <83cz9j9zyu.fsf@gnu.org> <838rk77yfo.fsf@gnu.org> <834juu9aya.fsf@gnu.org> <7cc9e03786024fc72f3b@heytings.org> <83a64l65ai.fsf@gnu.org> <7cc9e0378678a092e6ee@heytings.org> <835yf962q4.fsf@gnu.org> <7cc9e03786754c9e0aaf@heytings.org> <83zgcl4jra.fsf@gnu.org> <7cc9e03786c281cffdd4@heytings.org> <83tu2t4ie9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15529"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 59347@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 20 22:50:33 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1owsCu-0003lR-9u for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Nov 2022 22:50:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owsCT-0006dY-71; Sun, 20 Nov 2022 16:50:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owsCR-0006dA-ED for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 16:50:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owsCR-0007TV-52 for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 16:50:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owsCQ-00034C-Sn for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 16:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Nov 2022 21:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59347 X-GNU-PR-Package: emacs Original-Received: via spool by 59347-submit@debbugs.gnu.org id=B59347.166898099111745 (code B ref 59347); Sun, 20 Nov 2022 21:50:02 +0000 Original-Received: (at 59347) by debbugs.gnu.org; 20 Nov 2022 21:49:51 +0000 Original-Received: from localhost ([127.0.0.1]:44795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owsCE-00033M-HN for submit@debbugs.gnu.org; Sun, 20 Nov 2022 16:49:50 -0500 Original-Received: from heytings.org ([95.142.160.155]:52056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owsCB-000337-RG for 59347@debbugs.gnu.org; Sun, 20 Nov 2022 16:49:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1668980986; bh=cP0o0nYNmyPIkkxvCPMgWx8DVR9Pe2aif+1Dvi6ytmE=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=s/i5zWWlJRiHZCza8yiKPclYIH7pqXo2WSw+Hcmae55Sz6G0T1NvJX/2nSNxXGcFb YUtXvWaKR/6LaWrwKEGWISON4WAGeR/zJoOj824NUmTjXUX7Sx1cnHnYI2fz3TyS/c udx8uOyh4wP35gqRupx5DQYqMW/x/PhwKj6F3f4NF1MJgwQURNOmrOZvOi/1yYe42+ lsDekycQq1M/+fsB+BhJmiMkToKuXzHcPDi0GYjK3EHU6ZQ0me+XOeA3mTaSMxY7lz adD2mT2DSortKE2Hi2+WXjvIGNmBia6HAbQtMmuKxW6+PuDDtP4wjL+hDBV83yx8ot HOXBg1Hy93yNQ== In-Reply-To: <83tu2t4ie9.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248481 Archived-At: >>> Yes. We need to make sure the scoring will not now sometimes prefer >>> the medium weight where the regular weight exists and is a better >>> match. Not only should it not reject a legitimate font, but also not >>> prefer another font due to this change. IOW, the change should >>> ideally only affect the cases where the 'medium' weight doesn't exist, >>> and we therefore prefer to use 'regular' rather than reject the >>> family. >> >> I don't think the case you have in mind could happen in the scenario of >> this bug or bug#57555 (if a regular weight exists and is a better match >> the loop in font_find_for_lface will exit with that better match), but >> indeed with some other call sequence this could perhaps happen. I'll >> see what I can do. > > Thanks, it's indeed the other cases that I worry about. We had a lot of > changes in this area which solved one problem only to create others. > After looking at this a bit closer, I don't see how font_score could be changed, or even why it should be changed. It has only two callers: font_match_p and font_sort_entities. The former only checks whether its return value is > 0 (IOW it only checks whether the font is an exact match or not). The latter has only two callers: list-font and font_select_entity. The latter has only one caller: font_find_for_lface. So it seems to me that there are no execution paths that could be negatively affected by this change (which is in font_find_for_lface). Also, AFAIU, a font whose weight == spec_prop[weight] is in principle preferred to a font whose weight != spec_prop[weight]. However, a font whose weight != spec_prop[weight] could in practice be preferred to a font whose weight == spec_prop[weight] when it is a better match according to the other sorting criteria (size and width, and possibly type and slant). How could (and why should) this be changed to make sure that the scoring will not sometimes prefer the medium weight when the regular weight exists? I'm probably missing something, but what?