From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59347: 29.0.50; `:family` face setting ignored Date: Tue, 22 Nov 2022 15:47:50 -0500 Message-ID: References: <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> <7cc9e03786e324ff82ef@heytings.org> <83bkp04gjl.fsf@gnu.org> <83leo42vm9.fsf@gnu.org> <0d1ea3007fd94b7ae0b1@heytings.org> <83r0xv1649.fsf@gnu.org> <0d1ea3007f532a493429@heytings.org> <83cz9f12bh.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20199"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Gregory Heytings , 59347@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 22 21:52:27 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 1oxaFe-0004aQ-HZ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Nov 2022 21:52:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxaDO-0007Ym-HC; Tue, 22 Nov 2022 15:49:58 -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 1oxaCV-000756-5P for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2022 15:49: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 1oxaCU-0006zC-C2 for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2022 15:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxaCU-0004Hb-8Q for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2022 15:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2022 20:49: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.166915009516405 (code B ref 59347); Tue, 22 Nov 2022 20:49:02 +0000 Original-Received: (at 59347) by debbugs.gnu.org; 22 Nov 2022 20:48:15 +0000 Original-Received: from localhost ([127.0.0.1]:52661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxaBj-0004GX-4l for submit@debbugs.gnu.org; Tue, 22 Nov 2022 15:48:15 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxaBb-0004G0-3x for 59347@debbugs.gnu.org; Tue, 22 Nov 2022 15:48:13 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 67F6A1000ED; Tue, 22 Nov 2022 15:48:01 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C07E510002F; Tue, 22 Nov 2022 15:47:59 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1669150079; bh=/MPcrDSrwbmXMqgSUDYLWV0hgWHBSq6yzaHrTZw1iCk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=NMQoJojZFmD5d02FaNXVIc9FKgLOSF6gxwdDhI17UsRGsxwe55iOxy4b/DVDM3JwN vHE8CmpfIermqcjuzKME4ngNsqZwQHPMyUyoHkZqfqrsgoQzVtuzPaenDgfQeFtGRh NDhheTcv8sGs2t3laiXglR5kn6pemkAXOM3akodjDybyvhaREzsZhhHBTis5bwfQbJ Z6x+aLUXGabPFxy1uLkQBvj5yjLd1jbtXx7WiJWzP7pDlwR9cTzMI1Mwbvr5LqcdwH yiKic+seQDP9JWKjh9cjwnC5/KDFMWmtrcMOHnpkidc5du74th+xrZvrw1XD0njOje XBSLSMio+qnEA== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 86D891202DA; Tue, 22 Nov 2022 15:47:59 -0500 (EST) In-Reply-To: <83cz9f12bh.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 22 Nov 2022 16:38:58 +0200") 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:248677 Archived-At: >> That's not what it does, no. The loop in font_find_for_lface limits the >> number of fonts that are considered to some foundry, family, registry and >> additional style, and only considers more fonts if no suitable fonts have >> been found. > > But the same considerations apply to weight, slant, and width: shouldn't we > prefer an identical value for each one of those, if that is possible? The difference is that for numerical attributes there is a notion of proximity (plus some arbitrariness: very few users care whether a font is "normal" vs "regular" vs "medium", especially when the font of the family you requested has only one of those 3 and the font designed chose one of those three names somewhat arbitrarily). This makes the scoring work well for those. In contrast, we don't have such a notion for family/foundry/registry, which means scoring doesn't really work well for those attributes. So I think it makes sense to rely exclusively on scoring for the numerical attributes (width/weight/height/weight). At least intuitively it should give good results. For me the question is what is its impact in terms of the number of fonts we need to consider. [ Side note: the slant attribute could also be made numerical, I think. ] > And if no suitable candidate is found by making these 3 attributes free, > then we are back to the same problem, now with non-numerical attributes. > Right? Yes, but since they are not numerical/continuous attributes we can't see those weird discontinuities where you get font A for `semi-bold`, then font B for `normal`, then font A again for `light` (as in Gregory's example) which makes no sense: either A is heavier than B or not, but it can't be both, right? Stefan