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 15:35:06 +0000 Message-ID: <7cc9e0378678a092e6ee@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> 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="11932"; 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 16:36:19 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 1owmMl-0002u7-0y for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Nov 2022 16:36:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owmMZ-0004sl-48; Sun, 20 Nov 2022 10:36:07 -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 1owmMX-0004sK-40 for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 10:36:05 -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 1owmMU-0000AG-DC for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 10:36:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owmMU-00086r-56 for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 10:36: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 15:36: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.166895851031108 (code B ref 59347); Sun, 20 Nov 2022 15:36:02 +0000 Original-Received: (at 59347) by debbugs.gnu.org; 20 Nov 2022 15:35:10 +0000 Original-Received: from localhost ([127.0.0.1]:44341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owmLe-00085g-5f for submit@debbugs.gnu.org; Sun, 20 Nov 2022 10:35:10 -0500 Original-Received: from heytings.org ([95.142.160.155]:51510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owmLc-00085V-4t for 59347@debbugs.gnu.org; Sun, 20 Nov 2022 10:35:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1668958507; bh=pm/71hcLoA90IjvKm63KJawZ6/MPaEgENXs7yC9IgZU=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=sleZlKAVdaeWKfiGMdLv+u1EVl98UuSwj3b0nn4Cbq3b4cR7iBuPoUyTRWhz38mHK Afhvoeewtu+PzQb7xqhFGJXsqpKhQnWdDJ3ckHWr5HLr/PuKAnosBt324d1lxg+ALW D3ImexURZ/JRhhKifBo3P9moX0BHM/u5MzpEdN/sqPIRuZuwKkpAyIKnhRTSedWBTG Ihm8OaS7g/QiuV29/jjeDNY+poPDOUnEr10hLSnl64+4pvHHeJzN+ohYaKfFQkrdTz qPGsPQA0PMWgZFkN530zSkOQM89Yjm7GThMxm7iuvNPohCNidu4vN2CoypjEv3DvmQ tQbthunmUNbzw== In-Reply-To: <83a64l65ai.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:248430 Archived-At: > > I'd prefer to delay the discussion of this until after Stefan has time > to see why DejaVu Sans is rejected in his cases and describe his > findings. > > If you already did that, please describe your findings. > It's described in the commit message. DejaVu Sans is rejected because the font of the default face has a 'medium' weight, and DejaVu Sans (like many other fonts) does not explicitly support that weight. For many fonts (and for Emacs until recently), normal, regular and medium are the same weight. > > AFAIU, Stefan discovered that the problematic attribute was foundry, and > and your patch does nothing about foundry. > I don't know how he reached that conclusion, but it's most likely not the cause of the problem. > > It sounds like your patch is for another problem altogether. > I don't think so, at least my intention was to fix this bug (and also at least bug#57555, which is the same one). >> + /* If weight is "medium" in SPEC, also try "normal". Fonts with an >> + explicit "medium" weight are much less common than fonts with an >> + explicit "normal" weight, and for a long time "medium" and >> + "normal" (a.k.a. "regular" a.k.a. "book") were synonymous in >> + Emacs. See e.g. bug#59347 and bug#57555. */ >> + weight[0] = AREF (spec, FONT_WEIGHT_INDEX); >> + if (EQ (weight[0], Qmedium)) >> + weight[1] = Qnormal, weight[2] = zero_vector; >> + else >> + weight[1] = zero_vector; > > This is not enough, IMO: you need to make sure the scoring of candidates > is still correct. For example, if the weights of two candidates differ > (normal vs medium), but sizes are the same or close, how will that > compare with candidates whose weights are identical, but sizes differ? > IOW, we need to reconsider how font_score scores the candidates. > I don't understand your question. The patch essentially adds an inner loop in the loop of fond_find_for_lface, to make sure that when weight == medium, we call font_list_entities two times, first with (family, foundry, registry, adstyle, weight == medium) and then (if the previous call did not succeed to find a matching font, IOW, if it did not return nil) with (family, foundry, registry, adstyle, weight == normal) There is no scoring involved at that point, AFAIU.