From unknown Sun Jun 15 08:42:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#52888 <52888@debbugs.gnu.org> To: bug#52888 <52888@debbugs.gnu.org> Subject: Status: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX Reply-To: bug#52888 <52888@debbugs.gnu.org> Date: Sun, 15 Jun 2025 15:42:56 +0000 retitle 52888 29.0.50; font_{delete_unmatched,score} do not handle nil FONT= _WEIGHT_INDEX reassign 52888 emacs submitter 52888 Sean Whitton severity 52888 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 30 00:28:45 2021 Received: (at submit) by debbugs.gnu.org; 30 Dec 2021 05:28:45 +0000 Received: from localhost ([127.0.0.1]:50888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2nzZ-0002P1-E5 for submit@debbugs.gnu.org; Thu, 30 Dec 2021 00:28:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:45556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2nzX-0002Ot-GY for submit@debbugs.gnu.org; Thu, 30 Dec 2021 00:28:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2nzX-0000RE-8i for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 00:28:43 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:43135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2nzV-000526-7D for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 00:28:42 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7D19F5C0292 for ; Thu, 30 Dec 2021 00:28:38 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 30 Dec 2021 00:28:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:subject:date:message-id:mime-version:content-type; s= fm2; bh=+9KbHcsmVkLsi9UGTI5Yc34+HRb9JCu0ynBMmM+JuEI=; b=sl5cXggn GJ3ZjT7Iykc04cVitCb5CRDRwTv9WSOJD6wiw1mUpDxV+AzE4WkZ+nf/oe5Nfzrs O84sEhlV9t76gs7LT41V4RG1EBKdZzfbeHiBzf+5o5BiQo40fv196RTm6T3wv1Qp IgAOaSbofP0jycyH+EXNWcQ9DBfQNhQ4hOIvwa0z12C68stKQXQlHt1HNTv+9lli j81xzokyGHYNHX1pF+nj1e/lcfTKVmrVjXyC/MvyiAJHWYerVs+4t1E1G+EfITr4 25eLic2Xqs8tEK41kDmOeDqe0DgpPUygiT1hUYR4EWzJ96tMdXbYgeHAfrLIdion Dwvgd8ju1c2vDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=+9KbHcsmVkLsi9UGTI5Yc34+HRb9J Cu0ynBMmM+JuEI=; b=OFuW5HN6esRQ/gAQwDGAVkIkrTAvigwKzZLF0mzU2WoNG mwXCeT+d6EsYbgDzGanS3ImtXlDx611kdzhjXnyrQU7KDak40ky5AGnxWwDTs05k igaDhXhpJlsWvZOwL1F8cm+WalBx2jqvYOGzUpbgA3g4g+PGgt7WZH1IOvISdeMF Qe9QE4tXJRyz2QL+7seqEynyyguvcLEZPKjSk0pf582foYlzIKWw9rdmRaVkG/9Z n+I9kIYxYmERA+bx5OLard/xIubjzTias6GGt1ccbNEBkqsUPR82bdMJZuZEB4No CfdBcHH/OfaXC3u2FZsY4T+TmdhtEGDK8NFPfMCig== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddvvddgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufgffkfggtgesmhdttdertd ertdenucfhrhhomhepufgvrghnucghhhhithhtohhnuceoshhpfihhihhtthhonhesshhp fihhihhtthhonhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpefhuefhteetieefjeejud dtueeiteffjeffkeektdeltdeuffehteejleelkefhgeenucffohhmrghinhepghhithhh uhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 30 Dec 2021 00:28:38 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 314597F89D9; Wed, 29 Dec 2021 22:28:37 -0700 (MST) From: Sean Whitton To: bug-gnu-emacs@gnu.org Subject: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Wed, 29 Dec 2021 22:28:37 -0700 Message-ID: <87zgoi8xve.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=66.111.4.26; envelope-from=spwhitton@spwhitton.name; helo=out2-smtp.messagingengine.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) --=-=-= Content-Type: text/plain Hello, On my system I have a variable weight .ttf font[1] installed somewhere. When I build with --enable-check-lisp-object-type, the line int candidate = XFIXNUM (AREF (entity, prop)) >> 8; in font_delete_unmatched and the expression EMACS_INT diff = ((XFIXNUM (AREF (entity, i)) >> 8) - (XFIXNUM (spec_prop[i]) >> 8)); in font_score have failed assertions because the FONT_WEIGHT_INDEX for this .ttf file is nil: # I don't believe Emacs really knows how to handle these multi-weight .ttf files? Thus I propose the attached patch, to handle the value. [1] https://github.com/googlefonts/Inconsolata/tree/main/fonts/variable -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Handle-nil-FONT_WEIGHT_INDEX.patch >From b7eff2c3e1d09f44b1d5790275fc92c11e9be88f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 29 Dec 2021 21:18:07 -0700 Subject: [PATCH] Handle nil FONT_WEIGHT_INDEX * src/font.c (font_delete_unmatched, font_score): Handle nil entity property. In particular, FONT_WEIGHT_INDEX is nil for some variable weight fonts. --- src/font.c | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/font.c b/src/font.c index fa831f2861..cb057abca6 100644 --- a/src/font.c +++ b/src/font.c @@ -2183,7 +2183,8 @@ font_score (Lisp_Object entity, Lisp_Object *spec_prop) /* Score three style numeric fields. Maximum difference is 127. */ for (i = FONT_WEIGHT_INDEX; i <= FONT_WIDTH_INDEX; i++) - if (! NILP (spec_prop[i]) && ! EQ (AREF (entity, i), spec_prop[i])) + if (! NILP (spec_prop[i]) && ! NILP (AREF (entity, i)) + && ! EQ (AREF (entity, i), spec_prop[i])) { EMACS_INT diff = ((XFIXNUM (AREF (entity, i)) >> 8) - (XFIXNUM (spec_prop[i]) >> 8)); @@ -2764,26 +2765,31 @@ font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size) { if (FIXNUMP (AREF (spec, prop))) { - int required = XFIXNUM (AREF (spec, prop)) >> 8; - int candidate = XFIXNUM (AREF (entity, prop)) >> 8; + if (NILP (AREF (entity, prop))) + prop = FONT_SPEC_MAX; + else { + int required = XFIXNUM (AREF (spec, prop)) >> 8; + int candidate = XFIXNUM (AREF (entity, prop)) >> 8; - if (candidate != required + if (candidate != required #ifdef HAVE_NTGUI - /* A kludge for w32 font search, where listing a - family returns only 4 standard weights: regular, - italic, bold, bold-italic. For other values one - must specify the font, not just the family in the - :family attribute of the face. But specifying - :family in the face attributes looks for regular - weight, so if we require exact match, the - non-regular font will be rejected. So we relax - the accuracy of the match here, and let - font_sort_entities find the best match. */ - && (prop != FONT_WEIGHT_INDEX - || eabs (candidate - required) > 100) + /* A kludge for w32 font search, where listing a + family returns only 4 standard weights: + regular, italic, bold, bold-italic. For other + values one must specify the font, not just the + family in the :family attribute of the face. + But specifying :family in the face attributes + looks for regular weight, so if we require + exact match, the non-regular font will be + rejected. So we relax the accuracy of the + match here, and let font_sort_entities find the + best match. */ + && (prop != FONT_WEIGHT_INDEX + || eabs (candidate - required) > 100) #endif - ) - prop = FONT_SPEC_MAX; + ) + prop = FONT_SPEC_MAX; + } } } if (prop < FONT_SPEC_MAX -- 2.30.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 30 02:33:26 2021 Received: (at 52888) by debbugs.gnu.org; 30 Dec 2021 07:33:26 +0000 Received: from localhost ([127.0.0.1]:50938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2pwE-0006Eg-DJ for submit@debbugs.gnu.org; Thu, 30 Dec 2021 02:33:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2pwC-0006ES-HC for 52888@debbugs.gnu.org; Thu, 30 Dec 2021 02:33:25 -0500 Received: from [2001:470:142:3::e] (port=36822 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2pw7-0006u9-6U; Thu, 30 Dec 2021 02:33:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=M/peB35qAo/2a7EcFLQIqbFMRdhJ9afpipSYuIhpzKo=; b=Ctye4SEGBj8G M2WqAg0Qilt9Tqv78AlMboYQAz4xyd+bonM40OgDRd0uEycBfghQgEORWpZpOlxShiCGETYaB50Do ADuA5DykBOIimCzq8B6U+niJOESaTW71cKWIX5hZA7Z0+zDYxbQg02i+zV9L8IfgAwCRiz/yyAQem GJYbrPucWlL0qJJbayJrvAzhv77cgIS+qbUPOsXnBipMNxSHDKd5e7LEnMTPNHJ2xj11JJhtevD8I 3hAuuU2tM1PoK7lRiTlUxQvSM/9/gARqBJPKxhZllGuv3JEl3WAI9buyrz/qEo6v9XfKlyq7lPKhZ F3YQehH5cBWxvOuqbN4Ymg==; Received: from [87.69.77.57] (port=3827 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2pw0-0001xP-TN; Thu, 30 Dec 2021 02:33:19 -0500 Date: Thu, 30 Dec 2021 09:33:17 +0200 Message-Id: <83r19uim2q.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87zgoi8xve.fsf@melete.silentflame.com> (message from Sean Whitton on Wed, 29 Dec 2021 22:28:37 -0700) Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX References: <87zgoi8xve.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Date: Wed, 29 Dec 2021 22:28:37 -0700 > > On my system I have a variable weight .ttf font[1] installed somewhere. > When I build with --enable-check-lisp-object-type, the line > > int candidate = XFIXNUM (AREF (entity, prop)) >> 8; > > in font_delete_unmatched and the expression > > EMACS_INT diff = ((XFIXNUM (AREF (entity, i)) >> 8) > - (XFIXNUM (spec_prop[i]) >> 8)); > > in font_score have failed assertions because the FONT_WEIGHT_INDEX for > this .ttf file is nil: > > # 0 nil 100 0 ((:font-entity > "/usr/share/fonts/inconsolata/Inconsolata-VariableFont_wdth,wght.ttf" > . 0))> > > I don't believe Emacs really knows how to handle these multi-weight .ttf > files? Thus I propose the attached patch, to handle the value. Is the patch supposed to allow Emacs to handle these fonts, or is it just the protection against assertion violations? If the latter, isn't it better to teach the font driver to handle these fonts correctly? AFAIU, your patch basically will cause Emacs to reject such fonts and not use them, which is tantamount to telling users to configure Emacs to ignore them via, say, face-ignored-fonts. Is that right, or am I missing something? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 30 12:13:22 2021 Received: (at 52888) by debbugs.gnu.org; 30 Dec 2021 17:13:22 +0000 Received: from localhost ([127.0.0.1]:54326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2yzS-00013B-HT for submit@debbugs.gnu.org; Thu, 30 Dec 2021 12:13:22 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:34221) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2yzQ-00012s-Qu for 52888@debbugs.gnu.org; Thu, 30 Dec 2021 12:13:21 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id BB6B35C00BE; Thu, 30 Dec 2021 12:13:14 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 30 Dec 2021 12:13:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=hVwBXR/fOrdT8MnDW+0gb8hE7x qT+BG5XPtvb68B4ko=; b=nf3va1XZ9rmQ4NU58gXmP4OnXpqkUSIR9tgj3b1/Ro OQeNk8LjL1UZgzbPlwhiBRQDtwoyS7/N4xhI35QdwISk1SQEyrCB8Yr+S15jWsb1 303l6+GiO4Fr2yA8cyPExL2TDc4yBw5k+bmrXgNLLwMPnsGjKSzExuj+hS9Lx5Zt +lGyQVdBsIKTB/rPCpcLGpGgaE8o8EayayAZFU9dDOXod6nbPYvh3Q9NXh6uF4p+ su8zJe9PfVBruo9EFhoksqkeYigvtEfwGBQjlifDUwBjKgsKU1e63byRgTMGjPw7 L/24gr0dTMVfMhfiXql4aSwOdLh0UuPDgnny3Q4rQjJA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=hVwBXR /fOrdT8MnDW+0gb8hE7xqT+BG5XPtvb68B4ko=; b=V5HEXlOyXx69LJJh75YPX1 R1DwJb8tKnAoZIVRX46t0hZGwR076+tNGs/2cQlaQtMZ9Lb0JnekfOb7TBHGn+wF bgay6IaxlYlbydc536Yl0oRJOej5Ed2/ZrDg/eIwAFiJ1IcqkrAj82sSVbGkRR0G d3brjgFZRBmrK5XN0OcMuKiYHWH6ODjO19YFhlB/oetwuOYrSZkeUX0r7DklK29w lIy8SlAXyfJDYVJErKfNPCP6AYqlB63fb4hMCadEeM60e1Gj/pTnYeRxF/JpezQz DuN3zjtlWldYZJ9Y1ytWmDRCFioKOU6muAEroD7PHgXD7DePUzbQk0d4oVQbiN3A == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddvfedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhepleeggefgvdeijedvhfdugfegtefgkeekueeileejjeehudeg geefteeghfeuffeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Dec 2021 12:13:14 -0500 (EST) Received: by athena.silentflame.com (Postfix, from userid 1000) id 1FC661B64D4; Thu, 30 Dec 2021 17:13:13 +0000 (UTC) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX In-Reply-To: <83r19uim2q.fsf@gnu.org> References: <87zgoi8xve.fsf@melete.silentflame.com> <83r19uim2q.fsf@gnu.org> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Thu, 30 Dec 2021 10:13:13 -0700 Message-ID: <871r1uyq1i.fsf@athena.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Thu 30 Dec 2021 at 09:33am +02, Eli Zaretskii wrote: > Is the patch supposed to allow Emacs to handle these fonts, or is it > just the protection against assertion violations? The latter -- the code implicitly assumes that the weight will always be a fixnum, but that is not so. I want to fix that implicit assumption. > If the latter, isn't it better to teach the font driver to handle > these fonts correctly? > > AFAIU, your patch basically will cause Emacs to reject such fonts and > not use them, which is tantamount to telling users to configure Emacs > to ignore them via, say, face-ignored-fonts. Is that right, or am I > missing something? I don't think it is equivalent to face-ignored-fonts. The weight field in the entity vector is examined only when the weight field in the font spec is non-nil. So my code does not categorically reject these fonts: it rejects them only when the user requested a specific weight, AFAICT. I don't know enough about these variable weight TTFs to judge whether it is worth anyone's time adding better support for them in Emacs. In the case of Inconsolata-VariableFont_wdth,wght.ttf, the font authors provide separate .ttf files for each weight too, so there doesn't seem to be an expectation that applications know how to read the combined file. Thanks for looking! -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 30 13:39:30 2021 Received: (at 52888) by debbugs.gnu.org; 30 Dec 2021 18:39:30 +0000 Received: from localhost ([127.0.0.1]:54450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n30Ko-0006SY-C3 for submit@debbugs.gnu.org; Thu, 30 Dec 2021 13:39:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n30Km-0006SM-RH for 52888@debbugs.gnu.org; Thu, 30 Dec 2021 13:39:29 -0500 Received: from [2001:470:142:3::e] (port=50878 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n30Kg-0001B2-WE; Thu, 30 Dec 2021 13:39:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wnSFYyLmskBYEkTjqLDis4DlYrqP9Ff81IvbWGo0z+4=; b=WHOzIs07fYB0 vLvNxuh0fWccjz/LXnHunT7cwRhcH5OWLdBsmeNtvU4HnLKfWmBbTYVNnVqTteNrd9L14t3CyPXN6 yxae0lrv0TCy+6ndyuzCLt1r6eg2vDmHf3zRv0IwN37Ee+AVcBEzrHUmsf/3OCDPerKYwPekypFmp Fn3rYldTAlf1rZzamufgT+MPiBWGpp9sFpbxDK4GhpFA57ZY4/i6LG4GkaJVu9BbMDda2t9m8RsEP wQFh/kIASCkVJzjsQlLJybamreDSVm/JLJ3MFmGtD5ELbbPyo6A+bn69zvlSxjd452b1QJr0Yl1kl FqiEWWfUDIObniNrv2hlVA==; Received: from [87.69.77.57] (port=1323 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n30Kg-00071g-RI; Thu, 30 Dec 2021 13:39:23 -0500 Date: Thu, 30 Dec 2021 20:39:28 +0200 Message-Id: <8335mahr8f.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <871r1uyq1i.fsf@athena.silentflame.com> (message from Sean Whitton on Thu, 30 Dec 2021 10:13:13 -0700) Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX References: <87zgoi8xve.fsf@melete.silentflame.com> <83r19uim2q.fsf@gnu.org> <871r1uyq1i.fsf@athena.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: 52888@debbugs.gnu.org > Date: Thu, 30 Dec 2021 10:13:13 -0700 > > > Is the patch supposed to allow Emacs to handle these fonts, or is it > > just the protection against assertion violations? > > The latter -- the code implicitly assumes that the weight will always be > a fixnum, but that is not so. I want to fix that implicit assumption. > > > If the latter, isn't it better to teach the font driver to handle > > these fonts correctly? > > > > AFAIU, your patch basically will cause Emacs to reject such fonts and > > not use them, which is tantamount to telling users to configure Emacs > > to ignore them via, say, face-ignored-fonts. Is that right, or am I > > missing something? > > I don't think it is equivalent to face-ignored-fonts. The weight field > in the entity vector is examined only when the weight field in the font > spec is non-nil. So my code does not categorically reject these fonts: > it rejects them only when the user requested a specific weight, AFAICT. Does it really make sense to accept these fonts in some situations, but not in others? AFAIU, what you suggest would cause Emacs to accept these fonts when :weight is not mentioned (and so defaults to 'normal'), but to reject them if the 'normal' weight is specified explicitly, is that right? If so, it's confusing, and users will complain. Rejecting such fonts outright is at least consistent, and thus better than semi-support. > I don't know enough about these variable weight TTFs to judge whether it > is worth anyone's time adding better support for them in Emacs. In the > case of Inconsolata-VariableFont_wdth,wght.ttf, the font authors provide > separate .ttf files for each weight too, so there doesn't seem to be an > expectation that applications know how to read the combined file. I installed on the release branch a temporary fix, similar to what you suggested, to avoid undefined behavior with those fonts, but I don't think we should install something like that on master. On master, I think ftfont.c and its ilk should be fixed to handle these fonts correctly, or reject them if we cannot DTRT with them for some reason. I think the fact that we create invalid font entities from such fonts is a clear sign that the font backend mishandles them, and if so, that's where this problem should be corrected: we should create valid font entities to begin with, with ;weight and other similar attributes having numerical values, as expected. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 31 19:30:44 2021 Received: (at 52888) by debbugs.gnu.org; 1 Jan 2022 00:30:45 +0000 Received: from localhost ([127.0.0.1]:57597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3SIG-0006eg-Ii for submit@debbugs.gnu.org; Fri, 31 Dec 2021 19:30:44 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:50849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3SIF-0006eS-BZ for 52888@debbugs.gnu.org; Fri, 31 Dec 2021 19:30:43 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 4439A3200A39; Fri, 31 Dec 2021 19:30:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 31 Dec 2021 19:30:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=kPrtBbGXMRH+ULag0kiABK65Eo 3zh8Fdl287Y76j9tI=; b=p/vbs9GHrIAa1vmjVJKO0ZpAsl8bMZfA1IfytEQSVD zJ1Q1gm0dqdif9p/8NSIlMxDCzUJu52ti2cdgTZFAYDNf8wUjO0ANc0/c2QdGmab oYtwYS/uC1RU3qESFuKF+DKWalObEN+lN9wwvmJnkq6DNJzFE5hA7EEWFE1F+AP/ mIYzKLcchw65vUl1+kpes2na0RlBemTX3Ia3gsCEYdJ6XoUvaUE6brrstuZIc70p 4DmbCODBwzBJ1hiU8z1QX+oCaD+di4VxYEUatZ2mMxtENge+n8xcCmTSvb1YBMYW LFyylORx4dqCDok30vSaZKoFDlsY0/RFQInMtPfRp3yA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=kPrtBb GXMRH+ULag0kiABK65Eo3zh8Fdl287Y76j9tI=; b=P5XyzgLZ961UG+5PXsLLra qcV7Tnk0RLUvNtZAKFmZZ/Y8lCRmGWZoNmGSrFEEvSUWpT436aFv1Kokf7HEaxQs 6Y/WeMkzP9t3BJ12f2v0tvg0RNraMWHIu4OlFHdYji7EBWAfth1okHgXu4jFnj43 8p7usb6R4l3NRCnZjs7i6PRupO9LaoRtu90DrmJWUVWy4Eps6JcMr7pRp0sjOwX7 nAyQhyhxiQC32FeWVfR+5WbFmxJpBPpzHt92Vt99nvNIDj2pTE32yYsssy+HEDfu 0gjG7za2wCrBiZ+HBfmAtgm+0nbKNENrd/XArnOK6x0K+tJOdYvm8UY2yH81SOsA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddviedgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhephfeuieelgeefleehgeduhedvgfdtffdujeffffehueffveeg ffeuudehfeeihfeknecuffhomhgrihhnpehtthhfrdhsohenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhi thhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 31 Dec 2021 19:30:36 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 1B0E67F7B85; Fri, 31 Dec 2021 17:30:35 -0700 (MST) From: Sean Whitton To: Eli Zaretskii , 52888@debbugs.gnu.org Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX In-Reply-To: <8335mahr8f.fsf@gnu.org> References: <87zgoi8xve.fsf@melete.silentflame.com> <83r19uim2q.fsf@gnu.org> <871r1uyq1i.fsf@athena.silentflame.com> <8335mahr8f.fsf@gnu.org> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Fri, 31 Dec 2021 17:30:35 -0700 Message-ID: <87v8z4mh5g.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52888 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Thu 30 Dec 2021 at 08:39PM +02, Eli Zaretskii wrote: > Does it really make sense to accept these fonts in some situations, > but not in others? AFAIU, what you suggest would cause Emacs to > accept these fonts when :weight is not mentioned (and so defaults to > 'normal'), but to reject them if the 'normal' weight is specified > explicitly, is that right? If so, it's confusing, and users will > complain. Rejecting such fonts outright is at least consistent, and > thus better than semi-support. Ah, yes, that would indeed be confusing. > I installed on the release branch a temporary fix, similar to what you > suggested, to avoid undefined behavior with those fonts, but I don't > think we should install something like that on master. On master, I > think ftfont.c and its ilk should be fixed to handle these fonts > correctly, or reject them if we cannot DTRT with them for some reason. > I think the fact that we create invalid font entities from such fonts > is a clear sign that the font backend mishandles them, and if so, > that's where this problem should be corrected: we should create valid > font entities to begin with, with ;weight and other similar attributes > having numerical values, as expected. I spent some more time in gdb and learned the following. The ftcrhb backend returns a FcPattern for each of the weights contained in Inconsolata-VariableFont_wdth,wght.ttf. So Emacs does not need to learn anything special about these variable weight files in order to support them, I think. However, this code in ftfont_pattern_entity can sometimes set FONT_WEIGHT_INDEX to nil: if (FcPatternGetInteger (p, FC_WEIGHT, 0, &numeric) == FcResultMatch) { FONT_SET_STYLE (entity, FONT_WEIGHT_INDEX, make_fixnum (numeric)); } I haven't yet determined exactly when this can happen, but it suggests the problem is within FONT_SET_STYLE, as all the backend-specific code is doing is upplying 'numeric'. If I might ask a gdb question: to try to determine when this code can set FONT_WEIGHT_INDEX to nil, I set a breakpoint right after it and then tried condition NN NILP (AREF (entity, FONT_WEIGHT_INDEX)) but this didn't work -- is it possible to do something like that? Thanks. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 31 21:36:03 2021 Received: (at 52888) by debbugs.gnu.org; 1 Jan 2022 02:36:03 +0000 Received: from localhost ([127.0.0.1]:57662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3UFX-00025v-0N for submit@debbugs.gnu.org; Fri, 31 Dec 2021 21:36:03 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:39647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3UFV-00025N-6u for 52888@debbugs.gnu.org; Fri, 31 Dec 2021 21:36:01 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 5AB653200AF0; Fri, 31 Dec 2021 21:35:55 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 31 Dec 2021 21:35:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=WjOrQ4v39MHV1TJrwG0s0s6bhk urB9A/RTyOBJhsvoE=; b=sL8yj7PvcsfPbjXdq9yzd4dSX/Vo8PgwBtJVPJmO6e nw3eOCpFa3i3NL6fNHAiuKuBo9CB2uNoT3Wzzd2kS86HpmSFPJLYhO05nuO0gSrk QVEdZl3iw5JFaCTgbDIpkChKsNHLdGURQvfDBNX60/kJbYjbrx+RutdajYjWEznU vjROKvKGwcds9dJ4oaDcMvg01iqhRKMjrtJnvSnH5trAfJMjkzi9Z8tLV4cl3toO eZnyVLaT0qwgU0eLD9hkBevmzCkZPeV3FkCNfn3CuXOqTa7OJilERaW1w6xcPeTG uchl1E+eKey399l8DoyiUcF8mj0IDUmeviN0Dgg2kPSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=WjOrQ4 v39MHV1TJrwG0s0s6bhkurB9A/RTyOBJhsvoE=; b=cuKzH4pSMHJH7sEIUXz8xE 9FdoR6wfyAjD3TI5Ce90xLCErOXkLLax7VcYHSGw2fj/wJk5A/K5PoSLJWpsNwzM IKqsknUTHmGwM01kJbXQNZsgoRu6zRVQgvIy0GU6t7HSJ6h3kFCZO52DyUQhg6Bj HpszcsUur45OCCc8uTcu/0KsbxkFi72NVY7PW3SAWEyB7b53sxAB4aYOnu8hiH8k csJnki2avqokI4Ezn0YkFFI3cg9U/K4NH6p0E7An5R/KS5RifogZCGILkhpKlvIw nvrNPxWivDWMgpKjT+f0GU910AXQ3FtbQeCUxvk48i0brLdCv98Pp7UcfmCZ3yrA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddviedggeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhephfeuieelgeefleehgeduhedvgfdtffdujeffffehueffveeg ffeuudehfeeihfeknecuffhomhgrihhnpehtthhfrdhsohenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhi thhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 31 Dec 2021 21:35:54 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 196D47F83ED; Fri, 31 Dec 2021 19:35:53 -0700 (MST) From: Sean Whitton To: Eli Zaretskii , 52888@debbugs.gnu.org Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX In-Reply-To: <87v8z4mh5g.fsf@melete.silentflame.com> References: <87zgoi8xve.fsf@melete.silentflame.com> <83r19uim2q.fsf@gnu.org> <871r1uyq1i.fsf@athena.silentflame.com> <8335mahr8f.fsf@gnu.org> <87v8z4mh5g.fsf@melete.silentflame.com> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Fri, 31 Dec 2021 19:35:53 -0700 Message-ID: <87sfu8mbcm.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52888 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Fri 31 Dec 2021 at 05:30PM -07, Sean Whitton wrote: > The ftcrhb backend returns a FcPattern for each of the weights contained > in Inconsolata-VariableFont_wdth,wght.ttf. So Emacs does not need to > learn anything special about these variable weight files in order to > support them, I think. However, this code in ftfont_pattern_entity can > sometimes set FONT_WEIGHT_INDEX to nil: > > if (FcPatternGetInteger (p, FC_WEIGHT, 0, &numeric) == FcResultMatch) > { > FONT_SET_STYLE (entity, FONT_WEIGHT_INDEX, make_fixnum (numeric)); > } ... or FcPatternGetInteger returns something other than FcResultMatch, which is in fact what is happening. I tried FcPatternGetDouble in an else branch and that fails too, so it seems fontconfig cannot determine a weight for the variant in question. So, perhaps each of the if (FcPatternGetInteger (...)) conditionals that corresponds to one of the FONT_* fields that the font.c functions assume are fixnums should have an else branch to return Qnil? -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 01 01:56:25 2022 Received: (at 52888) by debbugs.gnu.org; 1 Jan 2022 06:56:25 +0000 Received: from localhost ([127.0.0.1]:57715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3YJV-0001BJ-8q for submit@debbugs.gnu.org; Sat, 01 Jan 2022 01:56:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3YJT-0001B2-I5 for 52888@debbugs.gnu.org; Sat, 01 Jan 2022 01:56:23 -0500 Received: from [2001:470:142:3::e] (port=53842 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3YJO-0005Ob-2S; Sat, 01 Jan 2022 01:56:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ThrZrBXcebcZ/HK9IIn6WkZWk/6ORrPGm+j9F8hwFDA=; b=RXbg0rM+hWPg 15kK9GjW+1UAIwKBiOUAEXxQ2EvaqNuXCltxCUhwLCZQoVkrJl4e7AS9JBtSFmMMOJ2HcaL9EfnkE aw1Qn9sIR7BhKKuLS/PMlay27HBICA+m73QNQWVYtiFPwsICgOUTna/lCYJfPJuFQSefs1GUfcAS6 JIV66klEn/eZ3LoOIotmhuo8YtmcHHOLfC5mcICPdXWGkr1awYF2JRdz/96Pe5PzYPw89on7aqhZo SZLmFy7gI8x5Qq0Fw7Zn82Os4V5Dfm7LLqcC8bkTBTmYOVJtHBtKrRaX4w8x3ZneV/pUwBAgM3cKQ KncqGzJx0EShbiE5jGhopQ==; Received: from [87.69.77.57] (port=4242 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3YJM-00042Q-DX; Sat, 01 Jan 2022 01:56:16 -0500 Date: Sat, 01 Jan 2022 08:56:15 +0200 Message-Id: <83v8z4eygg.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87v8z4mh5g.fsf@melete.silentflame.com> (message from Sean Whitton on Fri, 31 Dec 2021 17:30:35 -0700) Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX References: <87zgoi8xve.fsf@melete.silentflame.com> <83r19uim2q.fsf@gnu.org> <871r1uyq1i.fsf@athena.silentflame.com> <8335mahr8f.fsf@gnu.org> <87v8z4mh5g.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Date: Fri, 31 Dec 2021 17:30:35 -0700 > > If I might ask a gdb question: to try to determine when this code can > set FONT_WEIGHT_INDEX to nil, I set a breakpoint right after it and then > tried > > condition NN NILP (AREF (entity, FONT_WEIGHT_INDEX)) > > but this didn't work -- is it possible to do something like that? It should be possible if your Emacs was compiled with -g3. Perhaps try condition NN AREF (entity, FONT_WEIGHT_INDEX) == Qnil instead. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 01 02:15:27 2022 Received: (at 52888) by debbugs.gnu.org; 1 Jan 2022 07:15:27 +0000 Received: from localhost ([127.0.0.1]:57731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3Ybu-0001kU-Uf for submit@debbugs.gnu.org; Sat, 01 Jan 2022 02:15:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3Ybs-0001kC-NF for 52888@debbugs.gnu.org; Sat, 01 Jan 2022 02:15:25 -0500 Received: from [2001:470:142:3::e] (port=54132 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3Ybn-00072J-GV; Sat, 01 Jan 2022 02:15:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=JudGzijFcTLSa9dWm8fPauiRFmUyhy1uov15H4U4UDU=; b=hvYjkb0y/OAY nJcOwAEzEuoCgaEd2uEjtpXl2SFrjnfNMyWsKqtgu015k5Z9CBw3jNf1feWdfHZDVJRuLEjQZVuOv JOnwYk70oelf/Q0iThifye/JS4PAd+DxVjzb+yf4FN4c6bX1kA0dC+S7ct6Pih1lCCD+I00wPdv+v vJF5PVYmILvPO1Hb0Qp15NZxEZ7nCgn8gpxzEB7YeVqfs2TVkNNJAP7mjRYFsvTyOk7pVENtcgOMK /Rybkrw5HhakStppFcTSrkAN/AAD3madnfRTIglYlB4CluciB3WswHo1RndYj9Uj7sxITlfixqHnu CRslYdPtwTlNEe3fpw7YTg==; Received: from [87.69.77.57] (port=1502 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3Ybn-0000LT-Fv; Sat, 01 Jan 2022 02:15:19 -0500 Date: Sat, 01 Jan 2022 09:15:18 +0200 Message-Id: <83sfu8exkp.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87sfu8mbcm.fsf@melete.silentflame.com> (message from Sean Whitton on Fri, 31 Dec 2021 19:35:53 -0700) Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX References: <87zgoi8xve.fsf@melete.silentflame.com> <83r19uim2q.fsf@gnu.org> <871r1uyq1i.fsf@athena.silentflame.com> <8335mahr8f.fsf@gnu.org> <87v8z4mh5g.fsf@melete.silentflame.com> <87sfu8mbcm.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Date: Fri, 31 Dec 2021 19:35:53 -0700 > > > if (FcPatternGetInteger (p, FC_WEIGHT, 0, &numeric) == FcResultMatch) > > { > > FONT_SET_STYLE (entity, FONT_WEIGHT_INDEX, make_fixnum (numeric)); > > } > > ... or FcPatternGetInteger returns something other than FcResultMatch, > which is in fact what is happening. > > I tried FcPatternGetDouble in an else branch and that fails too, so it > seems fontconfig cannot determine a weight for the variant in question. > > So, perhaps each of the if (FcPatternGetInteger (...)) conditionals that > corresponds to one of the FONT_* fields that the font.c functions assume > are fixnums should have an else branch to return Qnil? Maybe. However, the question that I think we should ask ourselves at this point is whether there's a reasonable way to process these fonts into a font spec that Emacs expects. So if FcPatternGetInteger and FcPatternGetDouble don't do the job, perhaps there's another fontconfig function that does, or maybe these fonts need to be processed in some slightly different ways (like in a loop, for example) to produce the weight matches from them? Can you perhaps ask the developers of this font to help? Or maybe we could ask on the fontconfig forum? If it turns out that there's no way we could adapt our code to these fonts (which I'd find hard to believe), we should then look for a way of detecting them so that we could reject them on the font backend level, before they get into the platform-independent code in font.c, e.g. with the 'else' branch that you suggest. However, I suspect that the fact we don't have such branches is not just because we blindly assume that can "never happen", so maybe doing so would break something. In any case, trying to accept those fonts instead of rejecting them would be a better solution, if we can reasonably code it. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 01 17:31:30 2022 Received: (at 52888) by debbugs.gnu.org; 1 Jan 2022 22:31:30 +0000 Received: from localhost ([127.0.0.1]:59525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3muP-0000VZ-M2 for submit@debbugs.gnu.org; Sat, 01 Jan 2022 17:31:30 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:37521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3muH-0000V6-Tp for 52888@debbugs.gnu.org; Sat, 01 Jan 2022 17:31:28 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C99F65C0100; Sat, 1 Jan 2022 17:31:16 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 01 Jan 2022 17:31:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:subject:in-reply-to:date:message-id:mime-version :content-type; s=fm2; bh=3G/HX8kX2qB8Mgf7q2xuuqHn8COLsW64w+x4d0d GAJA=; b=FjsFytv++cTwuZFtDJK55WLBZLuglnXEOBu2G0lyFdsyycMyngZ2Xym Y1A8osWWMSIURlgMW8Z5uMVb7hUxmd8REyaWMWs+1DHsr/iKsU+NvaBI87bhTtlF c/JFk+Zu/38kSPHKPkmhd/rLcbXyKDfhHiEz6JnXKQeriq6ygfkxl6Ts/d9HeMcO ok/ro8iHfXSiY8eMP3lhREQX4JRXCFKatpDagciAMjIIIC8rCyN1Z0ZghgRKU4ru 9srpVj47cKoCaPPvKWmTrE35Cc+4n0O/mMwLQNyoddvhRQxsMw/FWC+ExJt+oEbQ R/fqTOxMKk7ArfmQ+GZwfe9XEKisBIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=3G/HX8kX2qB8Mgf7q 2xuuqHn8COLsW64w+x4d0dGAJA=; b=Watx8/EurDVmwlnf8iG5h/1nFNPh07C7/ MzWok3jJkmI/xw3Vewg7rAXobqtlJnQBX0MalotRgJmuzm4pF0arBTzN7b1z4NOE qEdU+x6hZKxjHR8hMDUJ+tOrmxKeDVvdebsWQyOldqrGTnwHoTgyJlVSj6irXQex hq7N6LxW2FhH7m995SBkYClktCKiWf0W/8R5RGM2L8rnExe5H596hgemRIEfeii8 kRdWZkd4jyhE6baeVAGP3GGx3fVERbDBzZfBW1MD9Alo0IfDjj1gsWOVDOY5lRrb WbpKl1X/V9qyLtv5Kc33MFC0Gn9sld84fWckDOl1ZU7V5rijmmxNw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddvjedgudeivdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffujgffkfggtgesthdttddttddttdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpefhgeelleelfffgleelueejleevfedtjeelffetudetvdejgedu hfffgfegffegueenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshhpfihhihhtthhonhesshhp fihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 1 Jan 2022 17:31:16 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id B54FB7F8301; Sat, 1 Jan 2022 15:31:15 -0700 (MST) From: Sean Whitton To: Eli Zaretskii , 52888@debbugs.gnu.org Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX In-Reply-To: <83sfu8exkp.fsf@gnu.org> X-TUID: kz7D24EaBi6a Date: Sat, 01 Jan 2022 15:31:15 -0700 Message-ID: <875yr3ay18.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52888 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Sat 01 Jan 2022 at 09:15am +02, Eli Zaretskii wrote: >> From: Sean Whitton >> Date: Fri, 31 Dec 2021 19:35:53 -0700 >> >> > if (FcPatternGetInteger (p, FC_WEIGHT, 0, &numeric) == FcResultMatch) >> > { >> > FONT_SET_STYLE (entity, FONT_WEIGHT_INDEX, make_fixnum (numeric)); >> > } >> >> ... or FcPatternGetInteger returns something other than FcResultMatch, >> which is in fact what is happening. >> >> I tried FcPatternGetDouble in an else branch and that fails too, so it >> seems fontconfig cannot determine a weight for the variant in question. >> >> So, perhaps each of the if (FcPatternGetInteger (...)) conditionals that >> corresponds to one of the FONT_* fields that the font.c functions assume >> are fixnums should have an else branch to return Qnil? > > Maybe. > > However, the question that I think we should ask ourselves at this > point is whether there's a reasonable way to process these fonts into > a font spec that Emacs expects. So if FcPatternGetInteger and > FcPatternGetDouble don't do the job, perhaps there's another > fontconfig function that does, or maybe these fonts need to be > processed in some slightly different ways (like in a loop, for > example) to produce the weight matches from them? Can you perhaps ask > the developers of this font to help? Or maybe we could ask on the > fontconfig forum? I've filed a bug[1] and posted to the fontconfig mailing list. To be clear, we are generating valid font specs for a number of weights available in this multi-weight .ttf. It's just that some of the variants that are in there do not seem to have a valid weight, or something like that. So if we give up on those variants, we wouldn't be giving up on the whole .ttf, so it's not a complete loss. [1] https://github.com/googlefonts/Inconsolata/issues/69 -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 02 21:05:00 2022 Received: (at 52888) by debbugs.gnu.org; 3 Jan 2022 02:05:01 +0000 Received: from localhost ([127.0.0.1]:33939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4Cia-0005Kk-Mt for submit@debbugs.gnu.org; Sun, 02 Jan 2022 21:05:00 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:42265) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4CiY-0005KW-5c for 52888@debbugs.gnu.org; Sun, 02 Jan 2022 21:04:59 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9AFE15C00CE for <52888@debbugs.gnu.org>; Sun, 2 Jan 2022 21:04:52 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 02 Jan 2022 21:04:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=5Ve2Miee+3Uk9gJRVBEPI9Bm14 W4JomE7hZJLzWBhc4=; b=fS9lPqlJCW2uWjBnQww6mmD9oQl4glmQNpdL0fuM7A JPDitkHvCBkzoVT4ZwFMOcICJSrbr8OGYCnhUVzg5VIkqzLMrC7NCyfttA4dfK/K y0a+RGV0AO/nKuy7vkmynbvYwidiSekL33oxz98TDCNEcJE6ItAtBquEjXdCAbc6 0wXl5gIIQENfHXqQ0NGvaJXZJEgUgu9DbE/yJiTy+Ux/EFeFutO8h7Lgr3lxmwUz vBV2rrqeoXtSqH6RnYULwZ4rToxqZIGgNuxbNNJQVxS5Kto77h8yPYtcPB0dTE3g CtIQ7fc+NMUyCPzYklx5Avo61cC0HBS0y05LXICMZA9A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=5Ve2Mi ee+3Uk9gJRVBEPI9Bm14W4JomE7hZJLzWBhc4=; b=A2AEj0S01jgc9nMoZzyKTy J2IUuUTuggMzukvSDas+sh6+zDLGiOfVI5xHM8QRTD03DB20QQ8Uw+IObxcYxIP1 pEDt4bYHkNajzeFw0e4W1DU+Rfvxs/qLHnDQ5tvH5d1LCJWWk7iwUkdeTG8pNNko eyyGKdGQPsK5DPCfXPPyEMbONNkkqPu43ycswAc5vh2xvf6R/jNqU7/xMFXD1rwh 7m6YyuVScrUT8uLhmOM4kcVpWvZgo1CYWDwsZmRfMQSdM0rnmIezKLb2hNbrMMB4 fykt4/cuiP9PDf+VFePD2xrsosztUmQyWw0D+MIPj9KUM+1C1S03f7b2zQ2yUD8Q == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudeftddggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffujghffgffkfggtgesthdttd dttdertdenucfhrhhomhepufgvrghnucghhhhithhtohhnuceoshhpfihhihhtthhonhes shhpfihhihhtthhonhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpefhhefhieeihfffge dttefhtdejteeljeehudduheehtdffvedtieffudetgeeukeenucffohhmrghinhepfhhr vggvuggvshhkthhophdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for <52888@debbugs.gnu.org>; Sun, 2 Jan 2022 21:04:52 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 2ADE57F93F3; Sun, 2 Jan 2022 19:04:51 -0700 (MST) From: Sean Whitton To: 52888@debbugs.gnu.org Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX In-Reply-To: <875yr3ay18.fsf@melete.silentflame.com> References: <875yr3ay18.fsf@melete.silentflame.com> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Sun, 02 Jan 2022 19:04:51 -0700 Message-ID: <87v8z1vakc.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52888 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Sat 01 Jan 2022 at 03:31PM -07, Sean Whitton wrote: > I've filed a bug[1] and posted to the fontconfig mailing list. for reference. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 04 21:10:59 2022 Received: (at 52888) by debbugs.gnu.org; 5 Jan 2022 02:10:59 +0000 Received: from localhost ([127.0.0.1]:39295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4vlS-0004rw-Sw for submit@debbugs.gnu.org; Tue, 04 Jan 2022 21:10:59 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:48101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4vlN-0004rg-Se for 52888@debbugs.gnu.org; Tue, 04 Jan 2022 21:10:57 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 773AE5C0189; Tue, 4 Jan 2022 21:10:48 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 04 Jan 2022 21:10:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:subject:in-reply-to:date:message-id:mime-version :content-type; s=fm2; bh=gAtwIwo8yLu9F30anvlu0ZXsj49jy8MNtj264yl U8yU=; b=cI1vo2IlOT8Ffh4c0c7AxRQU4fqU66JQO1tu8vOrTxZQvpsEukq0APB ty7SEaz/239e54kXIsXh78rEVRjHJXzSyt9plhqpS8//6GQsQYI2Kv9bYr7tG94v 5flgqiiUG3YS65Byx9nOzOheEbIwAJcuo1biIUYswjLpepbEOrHjpy9OzMGf8NSo Kh6ubNOZxzvuQPSmUimVvShyjHDo+ZNPbbU2Ss8lr1mG5C0Z0dz3vuGYRdvckLGB n44LdS3EYgQZ6yIUKb9Yu8mqxhrBSeaHjh/Vf5vQvWeB/P8sjW2YHWfcJrF4co7G HCkKq/O0a7aKRk0BWZzFCKG99IEZ/LA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=gAtwIwo8yLu9F30an vlu0ZXsj49jy8MNtj264ylU8yU=; b=OL5MGNYh6KYhSUTPu5GI+/QR7Y7lzl0WP H2XAleP84Jk4POfS/LK5SE5m72SM7RTOx07asUSijRQNsJ9sSWD7qVokjcaqRhdL q+OGPCAn+6No/mETF9H9CjkwV4tm2eFBjmIObO32bxQ6VqYzR67mZCxbbV0Vc4tj tyJbzRubz50It0f4IKLkIaXoSzB9433Rq2QjAec/MwXBoGx97DozzWftBjQ7ZRt/ 37B598GKhEriBZRXV8rfhp6EsXjHzXvuiCMcTZ52pWdmBHe12d61Y0alGmqOV84x aWGGHHu/lfMc7UlzGS7MAFAtHu4tpq/AogICPEYv48mv9lwPaaYcw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefgedggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfffkgggtsehmtddtredttddtnecuhfhrohhmpefuvggrnhcuhghh ihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqnecugg ftrfgrthhtvghrnhepleefffdvvefhgfehudeugefggfeffedvvdffuedvvdelgffghfff leehheetffehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Jan 2022 21:10:48 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 70D527F7ABB; Tue, 4 Jan 2022 19:10:46 -0700 (MST) From: Sean Whitton To: Eli Zaretskii , 52888@debbugs.gnu.org Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX In-Reply-To: <83sfu8exkp.fsf@gnu.org> Date: Tue, 04 Jan 2022 19:10:46 -0700 Message-ID: <87bl0raq55.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52888 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hello, On Sat 01 Jan 2022 at 09:15AM +02, Eli Zaretskii wrote: > However, the question that I think we should ask ourselves at this > point is whether there's a reasonable way to process these fonts into > a font spec that Emacs expects. So if FcPatternGetInteger and > FcPatternGetDouble don't do the job, perhaps there's another > fontconfig function that does, or maybe these fonts need to be > processed in some slightly different ways (like in a loop, for > example) to produce the weight matches from them? I received a helpful reply from Akira TAGOH on the fontconfig list. The problematic entries are not in fact additional font weights available to Emacs, but meta or virtual entries from which applications can extract information about the range of weights provided by the variable weight .ttf file. As we do not need to know the range of weights explicitly, the virtual entries are no use to us. We can just skip over them and process the non-virtual FcPattern entries we get for each weight. I'm attaching a patch which detects these virtual entries and skips over them. Maybe we could revert and replace the temporary fix with my patch? As a test, I tried calling FcPatternGetRange on the virtual entry for Inconsolata-VariableFont_wdth,wght.ttf and I got a range of 40 to 210. I confirmed that the weights of all the non-virtual entries fall within this range, inclusive. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Skip-virtual-FcPattern-entries-for-variable-weight-f.patch >From 4747fe3072c6fca0385203cef9b6e2661badaaba Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 4 Jan 2022 19:07:29 -0700 Subject: [PATCH] Skip virtual FcPattern entries for variable weight fonts * src/ftfont.c (ftfont_list): Pass FC_VARIABLE to FcObjectSetBuild. * src/ftfont.c (ftfont_pattern_entity): Skip meta/virtual FcPattern entries for variable weight fonts (Bug#52888). --- src/ftfont.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ftfont.c b/src/ftfont.c index cf592759ab..73276fdc86 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -184,11 +184,22 @@ ftfont_pattern_entity (FcPattern *p, Lisp_Object extra) int numeric; double dbl; FcBool b; + FcRange *range; if (FcPatternGetString (p, FC_FILE, 0, &str) != FcResultMatch) return Qnil; if (FcPatternGetInteger (p, FC_INDEX, 0, &idx) != FcResultMatch) return Qnil; + if (FcPatternGetRange (p, FC_WEIGHT, 0, &range) == FcResultMatch + && FcPatternGetBool (p, FC_VARIABLE, 0, &b) == FcResultMatch + && b == FcTrue) + /* This is a virtual/meta FcPattern for a variable weight font, + from which it is possible to extract an FcRange value + specifying the minimum and maximum weights available in this + file. We don't need to know that information explicitly, so + skip it. We will be called with an FcPattern for each actually + available, non-virtual weight. */ + return Qnil; file = (char *) str; key = Fcons (build_unibyte_string (file), make_fixnum (idx)); @@ -853,7 +864,7 @@ ftfont_list (struct frame *f, Lisp_Object spec) adstyle = Qnil; objset = FcObjectSetBuild (FC_FOUNDRY, FC_FAMILY, FC_WEIGHT, FC_SLANT, FC_WIDTH, FC_PIXEL_SIZE, FC_SPACING, FC_SCALABLE, - FC_STYLE, FC_FILE, FC_INDEX, + FC_STYLE, FC_FILE, FC_INDEX, FC_VARIABLE, #ifdef FC_CAPABILITY FC_CAPABILITY, #endif /* FC_CAPABILITY */ -- 2.30.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 05 07:37:55 2022 Received: (at 52888) by debbugs.gnu.org; 5 Jan 2022 12:37:55 +0000 Received: from localhost ([127.0.0.1]:39719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n55YB-00026j-Bp for submit@debbugs.gnu.org; Wed, 05 Jan 2022 07:37:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n55Y9-00026W-LC for 52888@debbugs.gnu.org; Wed, 05 Jan 2022 07:37:54 -0500 Received: from [2001:470:142:3::e] (port=40536 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n55Y3-00014b-TD; Wed, 05 Jan 2022 07:37:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xG1JHXyRtQQ6hcgCkYmFW+Vqfp58GDpDKpaIZfMTSNw=; b=SX0XNk2AuZfe Sl436JolAvZ1fCs210jON9q7AQzI2LjdrkvtR8HInhKcCcRB4dOqysz0DEIMd1NY9Os0FatFteyq7 AsOVxNbLupUoOa2YuV98zGkcb9EsHi3rB/vmYVr913giz7S0lnRaltSxeKWyVI1VPEi7H4Ib5jVMr TsmfkQ9+BXnAaFj+N/Iu+8KfG8bxLmR/3sgi/lut8GUAU9KxjmwzQxvdsHL2xvTurV1SufNd7FFwU 7nKpXBIjRd7g5aK8Y+Qtaxk/DlQIp9HKJKvn5mD6s89QWWV6fEz3l8VLk9Mhzt1Uz/cSj5fZ3+QBh s4iUsSyR1OUygv49O8+uCw==; Received: from [87.69.77.57] (port=3081 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n55Y3-0007Om-QC; Wed, 05 Jan 2022 07:37:48 -0500 Date: Wed, 05 Jan 2022 14:37:56 +0200 Message-Id: <83tuei9x3v.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87bl0raq55.fsf@melete.silentflame.com> (message from Sean Whitton on Tue, 04 Jan 2022 19:10:46 -0700) Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX References: <87bl0raq55.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Date: Tue, 04 Jan 2022 19:10:46 -0700 > > I received a helpful reply from Akira TAGOH on the fontconfig list. The > problematic entries are not in fact additional font weights available to > Emacs, but meta or virtual entries from which applications can extract > information about the range of weights provided by the variable weight > .ttf file. > > As we do not need to know the range of weights explicitly, the virtual > entries are no use to us. We can just skip over them and process the > non-virtual FcPattern entries we get for each weight. I'm attaching a > patch which detects these virtual entries and skips over them. Thanks, very good news! > Maybe we could revert and replace the temporary fix with my patch? According to what I see in the documentation, FcPatternGetRange exists only since version 2.11.91 of Fontconfig, whereas we support 2.2.0 and up. So we cannot unconditionally use that API, and some part of the temporary solution will have to be left in the source. I'd need to see the final patch with that in mind, before I can decide whether it is simple/safe enough for the release branch. > --- a/src/ftfont.c > +++ b/src/ftfont.c > @@ -184,11 +184,22 @@ ftfont_pattern_entity (FcPattern *p, Lisp_Object extra) > int numeric; > double dbl; > FcBool b; > + FcRange *range; > > if (FcPatternGetString (p, FC_FILE, 0, &str) != FcResultMatch) > return Qnil; > if (FcPatternGetInteger (p, FC_INDEX, 0, &idx) != FcResultMatch) > return Qnil; > + if (FcPatternGetRange (p, FC_WEIGHT, 0, &range) == FcResultMatch > + && FcPatternGetBool (p, FC_VARIABLE, 0, &b) == FcResultMatch > + && b == FcTrue) > + /* This is a virtual/meta FcPattern for a variable weight font, > + from which it is possible to extract an FcRange value > + specifying the minimum and maximum weights available in this > + file. We don't need to know that information explicitly, so > + skip it. We will be called with an FcPattern for each actually > + available, non-virtual weight. */ > + return Qnil; I'm far from being an expert on Fontconfig programming, but the above use of 'range' looks strange: it's a pointer that starts pointing to some random (potentially invalid) address, and you pass its address to FcPatternGetRange, which presumably assigns to it a valid point. But doesn't that valid pointer need to be released somehow after we use it? Or does it point to static area(s)? I cannot find anything in the Fontconfig documentation about the memory-management protocols for FcValue objects, but maybe we should call FcValueDestroy on it after we are done with it? Or maybe this is not needed, as this passage from the docs says near the end: void FcValueDestroy (FcValue v) Frees any memory referenced by `v'. Values of type FcTypeString, FcTypeMatrix and FcTypeCharSet reference memory, the other types do not. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 05 08:55:12 2022 Received: (at 52888) by debbugs.gnu.org; 5 Jan 2022 13:55:12 +0000 Received: from localhost ([127.0.0.1]:39756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56ky-0004AK-8k for submit@debbugs.gnu.org; Wed, 05 Jan 2022 08:55:12 -0500 Received: from mail-wm1-f44.google.com ([209.85.128.44]:43706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56kv-00049z-VQ for 52888@debbugs.gnu.org; Wed, 05 Jan 2022 08:55:11 -0500 Received: by mail-wm1-f44.google.com with SMTP id k66-20020a1ca145000000b00345fa984108so3365358wme.2 for <52888@debbugs.gnu.org>; Wed, 05 Jan 2022 05:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=vnpIdcAFkMprYI4adJXs5R3lV9NvuJeMdYITh1V+Bh0=; b=m14iLdSMDLIgOekXd/DwQlk7+Grr++WKlM6AWTOHKtFzHux5erQI6J61TQjv26jF2n kOux3MI3EjsgHX3Ntm5hPxQCEMhsrLA+W0nh9el0FtOyWll+aWRgbiKe0JpIdD+zgn1Z zIBz9df/fBFQCYG9ol/edpIaTxRMXgmx2izk5mibU6BQCJeTzmkjXOGLyGVeMyQo7tT0 l/I26ru+3JWhlBw0BVrNL4r8EZFCU0Qqtw0zKV5e3xzVQIx38/uXR2c9kdSYryivV919 zumcAimKrvP9Go55Nxu+t87IgUBnHCymnrJuLaElmY10CVDLZ/FZlBrfIenkysCNj1/J ib6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=vnpIdcAFkMprYI4adJXs5R3lV9NvuJeMdYITh1V+Bh0=; b=hTNuK7X8lCtUIY/tTCL+fDcZ24AYw7PWb/qyEy4yL8Z/cS3ZUOVPZe16ggi1ZZ7wpj 58aKF3xixTVI+BHIm4y96wcStjzgbuVfbgd1BLE9u2zbNHw5ejvcxCD4Palm9fASNqXv 3F9QE7MDBA4ZMrTUFlrdfxVFvvQ4UxxYQ7P8tcL0qs0wFdK64P3i5LicVv6zlPqSGK3b hGXS6SMYq9Dc8gbPpltVLDhbUujJKJNLHWL/nMwt6Qg3oWZ3zLoiyiF/jqdn0q9DQc6Y KevZBoCo/sCn9EnJVyU2aLJ8jbP/cqSyQ7RE6JJsRqf/no8AK20cFws/vqDqxkaDppK9 LCcg== X-Gm-Message-State: AOAM531rc3aUAOz+dz+X20iBQwNtXLiZqdJxOn9MIfGiu8/XiI3+ScYB pp7WyhuO7CcATV4/a0Ci8jsMqTyGp4c= X-Google-Smtp-Source: ABdhPJyH7AlFOi2X3e6cNTMr8GOicIZz130tymOMlgwzPYpOFzwTr6PnYuyUvVdF5VZVIo/aHHJV/A== X-Received: by 2002:a05:600c:ac4:: with SMTP id c4mr2937819wmr.81.1641390903655; Wed, 05 Jan 2022 05:55:03 -0800 (PST) Received: from rltb ([2a01:e0a:3f3:fb50:32f5:4bb4:3da9:8697]) by smtp.gmail.com with ESMTPSA id c7sm46377851wri.21.2022.01.05.05.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 05:55:03 -0800 (PST) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX References: <87bl0raq55.fsf@melete.silentflame.com> <83tuei9x3v.fsf@gnu.org> Date: Wed, 05 Jan 2022 14:55:02 +0100 In-Reply-To: <83tuei9x3v.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 05 Jan 2022 14:37:56 +0200") Message-ID: <87tuei8eyx.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org, Sean Whitton X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Wed, 05 Jan 2022 14:37:56 +0200, Eli Zaretskii said: Eli> I'm far from being an expert on Fontconfig programming, but the ab= ove Eli> use of 'range' looks strange: it's a pointer that starts pointing = to Eli> some random (potentially invalid) address, and you pass its addres= s to Eli> FcPatternGetRange, which presumably assigns to it a valid point. = But Eli> doesn't that valid pointer need to be released somehow after we use Eli> it? Or does it point to static area(s)? I cannot find anything in Eli> the Fontconfig documentation about the memory-management protocols= for Eli> FcValue objects, but maybe we should call FcValueDestroy on it aft= er Eli> we are done with it? Or maybe this is not needed, as this passage Eli> from the docs says near the end: Eli> void FcValueDestroy (FcValue v) Eli> Frees any memory referenced by `v'. Values of type FcTypeStr= ing, Eli> FcTypeMatrix and FcTypeCharSet reference memory, the other t= ypes Eli> do not. Based on an admittedly quick reading of the fontconfig code, it=CA=BCs not our responsibility to deallocate the FcRange here; it ends up pointing to memory previously allocated internally by fontconfig. Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 05 09:08:09 2022 Received: (at 52888) by debbugs.gnu.org; 5 Jan 2022 14:08:09 +0000 Received: from localhost ([127.0.0.1]:39790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56xU-0004XB-RM for submit@debbugs.gnu.org; Wed, 05 Jan 2022 09:08:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56xL-0004Vh-VH for 52888@debbugs.gnu.org; Wed, 05 Jan 2022 09:08:00 -0500 Received: from [2001:470:142:3::e] (port=43140 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n56xG-0006am-3m; Wed, 05 Jan 2022 09:07:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Rp8zn3leJtcTInS/UpaoOXUHAnpJ/2nko2B1lszmN2M=; b=o3zwH+qNs1Psv125ODrq wttKnZsbZsGfiL/SrLp0UEeyp8RnyM4oJgCWoFUw0AmjYdStPMQhBO8OkeI02pJlWRbM9/gIqHxxw usRCN+xjLUaJyEhpy7HNpOcu1L0NbStUIlbXtR15fLyP1E/isAwjI4hh/Tvo3VRbD8FzGnjh/tGbS yHKw8jwi5y1cnXYzShWwnvLtI6KIzzeMBnH/58UQZ1BQPVztRIRHs4H7Z3RJCEI5E6XXi8ZpCgd6T Xy9TUIGhHsg9hT6K7AeFqO5lerGm504WuczO+RSdCrbNig/tgXIVUUUZFwmqmnPKL78ZiKzxwoRM4 opw2Au/m+1fJoQ==; Received: from [87.69.77.57] (port=4742 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n56xG-0006Kh-4k; Wed, 05 Jan 2022 09:07:54 -0500 Date: Wed, 05 Jan 2022 16:08:04 +0200 Message-Id: <83k0fe9sxn.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-Reply-To: <87tuei8eyx.fsf@gmail.com> (message from Robert Pluim on Wed, 05 Jan 2022 14:55:02 +0100) Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX References: <87bl0raq55.fsf@melete.silentflame.com> <83tuei9x3v.fsf@gnu.org> <87tuei8eyx.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Cc: Sean Whitton , 52888@debbugs.gnu.org > Date: Wed, 05 Jan 2022 14:55:02 +0100 > > Based on an admittedly quick reading of the fontconfig code, itʼs not > our responsibility to deallocate the FcRange here; it ends up pointing > to memory previously allocated internally by fontconfig. OK, thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 06 00:42:04 2022 Received: (at 52888) by debbugs.gnu.org; 6 Jan 2022 05:42:04 +0000 Received: from localhost ([127.0.0.1]:39464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5LXI-0003eM-Bc for submit@debbugs.gnu.org; Thu, 06 Jan 2022 00:42:04 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:35067) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5LXG-0003do-3B for 52888@debbugs.gnu.org; Thu, 06 Jan 2022 00:42:02 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E56C75C009A; Thu, 6 Jan 2022 00:41:56 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 06 Jan 2022 00:41:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:cc:subject:in-reply-to:date:message-id:mime-version :content-type; s=fm2; bh=RCmNQxUuigenCQtkpJYO0hLIiM70dRTkv4H58k+ Tu6Q=; b=beHu+wPdNMgR7m2Wx6ygwOGXvZQaZOiVm4fPO0EmTq0Mo6/1NTbwXyA 1U3h0YGDoRRDD/HGOdIMow0M0aiK6/AT2CMnYBIzbQ64OavNz+VfvDauwDi+0H0S fpC7MWlpDjLfDlRUir7bKqNmRK65YUV1LZpD6XDpObeRtyVRMiQXUYvKG3V5NQlC pr2R02SB43Z6S6T3f/i1Muo+pqh1T6r3/oM+qOTcBTEDmpz0j3RYXSwwr2lvoTMm nKRu/NFhBRaoMtHUlA8nr3Vq/IMMyh0GDPp2WUBaItm0CR1vExNIbIboIMLsdfb9 DklNBpsQyVao34aKCd3Ny9cpwnQ5wGg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=RCmNQxUuigenCQtkp JYO0hLIiM70dRTkv4H58k+Tu6Q=; b=e9FQfXvWFReu1obaqOxL05K2ktNYd/6L/ lb+dpjC3MJ+uZ6aW9EX5DUsQ1H1zC3nxdFLhNVlC7DuI6pW1XRBnSvFHlZb3E5q7 JlZXf2Lx5+lRrXuKmcqLuMS6MIBanLuoneZpDtS6GQq51kKkvnUI/nFf3HBuikMf l5xIp9i5SuUe+RdVjVjBT1SYhtDfpoprpnJe3ZCXDEQ/XG0d7qxTrUHJYvinUDpb iFc1rzhiuhhs9Dqbhgx5QBW+DItmftIAHtaGEujwS2fNlhFleDU/hdLXX1s7dgqb a3EEeJ48I0LPUX4kVrhqCtbCsJ4T866TaF6TP6kyIoI3AuiRaRI0w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefkedgtdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfffkgggtsehmtddtredttddtnecuhfhrohhmpefuvggrnhcuhghh ihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqnecugg ftrfgrthhtvghrnhepieehffeuheegkeffvdelheegteeutdetgfekhfelleffjeffffek hedvuddtgfetnecuffhomhgrihhnpegtohhnfhhighhurhgvrdgrtgenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsphifhhhithhtohhnsehs phifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Jan 2022 00:41:56 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 7B3EA7F952E; Wed, 5 Jan 2022 22:41:55 -0700 (MST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX In-Reply-To: <83tuei9x3v.fsf@gnu.org> Date: Wed, 05 Jan 2022 22:41:55 -0700 Message-ID: <87czl55skc.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hello, On Wed 05 Jan 2022 at 02:37PM +02, Eli Zaretskii wrote: > According to what I see in the documentation, FcPatternGetRange exists > only since version 2.11.91 of Fontconfig, whereas we support 2.2.0 and > up. Ah, right. Is this version bound written down anywhere other than the conditionals in configure.ac? Sorry I didn't think to look there. > So we cannot unconditionally use that API, and some part of the > temporary solution will have to be left in the source. I'd need to > see the final patch with that in mind, before I can decide whether it > is simple/safe enough for the release branch. My patch requires FC_VARIABLE which was not added until 2.12.91, so in the attached revision I've set up preprocessor conditionals based on FC_VARIABLE. Checking that FC_VARIABLE is true is how we know it's one of the virtual entries. It looks like fontconfig commit 83b41611 introduced the meta patterns under discussion. The first tagged release including that commit is 2.12.91. So AFAICT nothing of the old fix need remain. > I'm far from being an expert on Fontconfig programming, but the above > use of 'range' looks strange: it's a pointer that starts pointing to > some random (potentially invalid) address, and you pass its address to > FcPatternGetRange, which presumably assigns to it a valid point. But > doesn't that valid pointer need to be released somehow after we use > it? Or does it point to static area(s)? I cannot find anything in > the Fontconfig documentation about the memory-management protocols for > FcValue objects, but maybe we should call FcValueDestroy on it after > we are done with it? Or maybe this is not needed, as this passage > from the docs says near the end: Yes, I was surprised too, but as has been mentioned, the FcPatternGet* functions are documented as supplying pointers to storage which must not be freed. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v2-0001-Skip-virtual-FcPattern-entries-for-variable-weigh.patch >From d88f23882b66243b42d79e0fe897f99f8125c7c4 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 4 Jan 2022 19:07:29 -0700 Subject: [PATCH v2] Skip virtual FcPattern entries for variable weight fonts * src/ftfont.c (ftfont_list): Pass FC_VARIABLE to FcObjectSetBuild. * src/ftfont.c (ftfont_pattern_entity): Skip meta/virtual FcPattern entries for variable weight fonts (Bug#52888). --- src/ftfont.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/ftfont.c b/src/ftfont.c index 2bdcce306b..6bfbc50ffa 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -189,6 +189,19 @@ ftfont_pattern_entity (FcPattern *p, Lisp_Object extra) return Qnil; if (FcPatternGetInteger (p, FC_INDEX, 0, &idx) != FcResultMatch) return Qnil; +#ifdef FC_VARIABLE + FcRange *range; + if (FcPatternGetRange (p, FC_WEIGHT, 0, &range) == FcResultMatch + && FcPatternGetBool (p, FC_VARIABLE, 0, &b) == FcResultMatch + && b == FcTrue) + /* This is a virtual/meta FcPattern for a variable weight font, + from which it is possible to extract an FcRange value + specifying the minimum and maximum weights available in this + file. We don't need to know that information explicitly, so + skip it. We will be called with an FcPattern for each actually + available, non-virtual weight. */ + return Qnil; +#endif /* FC_VARIABLE */ file = (char *) str; key = Fcons (build_unibyte_string (file), make_fixnum (idx)); @@ -863,6 +876,9 @@ ftfont_list (struct frame *f, Lisp_Object spec) #if defined HAVE_XFT && defined FC_COLOR FC_COLOR, #endif +#ifdef FC_VARIABLE + FC_VARIABLE, +#endif /* FC_VARIABLE */ NULL); if (! objset) goto err; -- 2.30.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 06 07:29:31 2022 Received: (at 52888) by debbugs.gnu.org; 6 Jan 2022 12:29:31 +0000 Received: from localhost ([127.0.0.1]:39853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5Rta-0005fv-Nq for submit@debbugs.gnu.org; Thu, 06 Jan 2022 07:29:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5RtY-0005fj-Tj for 52888@debbugs.gnu.org; Thu, 06 Jan 2022 07:29:29 -0500 Received: from [2001:470:142:3::e] (port=41988 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5RtT-0007rq-Hn; Thu, 06 Jan 2022 07:29:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=WZKao3ZbMFa098n7a1U4RYshSPissMS4u1JGIIHrkR8=; b=knkO+nLm7LJz xhlBhsPKay1dZyVl1bODPW61CVKPZauA/rbhjoqC7mtw3wCXflFFn8x+fJMmys9+rBToh+0u+RNei 4hlbKhydG5s0p6io1vPuwK5EQRtJaLd6PcvFzsE/xP6iHUsjHsv+mOTlgGUhd/8jWXWlp64XmqfP+ XtjLXp/PV8rIoZxwJ+5Aj6jpMZtpuKigrWdcvfVU0KOy+omZHnUTIdlAMaY/qNi7luQvxPENrVlwx dP21LzcVFktJ66WqHdDOgoHKFSZRYzzaTpM7ukQbtHX6KOtNc4O4C6oGPZGFyWywlXSnds3Uax78W y6YuM7ksuOoaz9/IOdIzjw==; Received: from [87.69.77.57] (port=3371 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5RtT-0008Rb-EI; Thu, 06 Jan 2022 07:29:23 -0500 Date: Thu, 06 Jan 2022 14:29:34 +0200 Message-Id: <83a6g982tt.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87czl55skc.fsf@melete.silentflame.com> (message from Sean Whitton on Wed, 05 Jan 2022 22:41:55 -0700) Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX References: <87czl55skc.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: 52888@debbugs.gnu.org > Date: Wed, 05 Jan 2022 22:41:55 -0700 > > > According to what I see in the documentation, FcPatternGetRange exists > > only since version 2.11.91 of Fontconfig, whereas we support 2.2.0 and > > up. > > Ah, right. Is this version bound written down anywhere other than the > conditionals in configure.ac? Sorry I didn't think to look there. No, I don't think we document the minimum versions of prerequisites anywhere. > > So we cannot unconditionally use that API, and some part of the > > temporary solution will have to be left in the source. I'd need to > > see the final patch with that in mind, before I can decide whether it > > is simple/safe enough for the release branch. > > My patch requires FC_VARIABLE which was not added until 2.12.91, so in > the attached revision I've set up preprocessor conditionals based on > FC_VARIABLE. Checking that FC_VARIABLE is true is how we know it's one > of the virtual entries. OK, but (a) we need a comment there explaining why FC_VARIABLE is used as the condition, and (b) we'd also need to merge the temporary fix in font.c to master. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 06 13:10:23 2022 Received: (at 52888) by debbugs.gnu.org; 6 Jan 2022 18:10:23 +0000 Received: from localhost ([127.0.0.1]:42128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5XDS-00049o-Rf for submit@debbugs.gnu.org; Thu, 06 Jan 2022 13:10:23 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:49961) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5XDQ-00049G-IX for 52888@debbugs.gnu.org; Thu, 06 Jan 2022 13:10:21 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 8A289320377B; Thu, 6 Jan 2022 13:10:14 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 06 Jan 2022 13:10:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=vo/p55292W/e1P2qgWvP4C1Oii RuuxmM1iG3m6/jzpI=; b=1eWsm8acy8xhojO39A9L2WnmtwSXHBZJW7FspV263Q hR9G8pST5dKulUpGH65TNwufpTspYBn/oXtSFJlj6HGOHXSB/ppcP8gPOXW02gYE PDUJAAnSxTrROVLMEzQwbS5yO0SBSAqRxFnqmThRgeg92hLZazr21nTNdEHYOGIN 2OuR3OzAxOOux0v82MU4YOv7qCXQENN62PHt/m2L5rEDV3B7mz2ZqY/xeSTcclWQ e2Dp9F4pJ9/vPKguh4gIQ4srPO5smSTPZSRFOeyeQfvWqtwf8f1J0JxmcuRl+Gmr WdTOJgIUU5GgqSHgLsm7xFXw/RxQ6jDTKlic8e2Y3AtA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=vo/p55 292W/e1P2qgWvP4C1OiiRuuxmM1iG3m6/jzpI=; b=Rym3Eb4nAXcgsN48O7x+qC OD7kbSzDky/4+nvlCDxKjiVLcMUZgmW0n+pbOg1nxJSw4S9n7oEfdaD9gTn6uFto 7swuopcBMmSQXbYBfIjVMJJvghMMkj5bBBJXfd6g5G/NNks4GTeIoTxi0Cyjh3Dd DPn44SfF20yktNvrulrdiN2lJgOngxAwyd5ynmEPh14P039TczJBiysc3myyIjNY TGk9M0L1myaJQWtaxlGVjG5vvDEivwLTU/FDcGY1w2rIm+lZmXoz+rX2j4Yv2bsW P/aKWCpQWZGZjEBlrjqG6+EVK0DWkNy/k4/mb2SJQvqctL/4aA3k5ZwSGKSjjRlw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefledguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffujghffgffkfggtgesmhdttdertdertdenucfhrhhomhepufgvrghn ucghhhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpefgueeutedvkeffgedvveetheejieetvdduvdffheevgfet vdfghfetteffvdevjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Jan 2022 13:10:13 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 9BFDF7F973E; Thu, 6 Jan 2022 11:10:12 -0700 (MST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX In-Reply-To: <83a6g982tt.fsf@gnu.org> References: <87czl55skc.fsf@melete.silentflame.com> <83a6g982tt.fsf@gnu.org> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Thu, 06 Jan 2022 11:10:12 -0700 Message-ID: <87pmp4d9bv.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hello, On Thu 06 Jan 2022 at 02:29PM +02, Eli Zaretskii wrote: > OK, but (a) we need a comment there explaining why FC_VARIABLE is used > as the condition, and (b) we'd also need to merge the temporary fix in > font.c to master. Here's an updated patch. I don't think I can help with (b) but let me know if there's something I can do. Thanks! -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v3-0001-Skip-virtual-FcPattern-entries-for-variable-weigh.patch >From 8f2c3b969af77e707429ac4a51fa439831c5d075 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 4 Jan 2022 19:07:29 -0700 Subject: [PATCH v3] Skip virtual FcPattern entries for variable weight fonts * src/ftfont.c (ftfont_list): Pass FC_VARIABLE to FcObjectSetBuild. * src/ftfont.c (ftfont_pattern_entity): Skip meta/virtual FcPattern entries for variable weight fonts (Bug#52888). --- src/ftfont.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ftfont.c b/src/ftfont.c index 2bdcce306b..5797300d23 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -189,6 +189,24 @@ ftfont_pattern_entity (FcPattern *p, Lisp_Object extra) return Qnil; if (FcPatternGetInteger (p, FC_INDEX, 0, &idx) != FcResultMatch) return Qnil; +#ifdef FC_VARIABLE + /* This is a virtual/meta FcPattern for a variable weight font, from + which it is possible to extract an FcRange value specifying the + minimum and maximum weights available in this file. We don't + need to know that information explicitly, so skip it. We will be + called with an FcPattern for each actually available, non-virtual + weight. + + Fontconfig started generating virtual/meta patterns for variable + weight fonts in the same release that FC_VARIABLE was added, so + we conditionalize on that constant. This also ensures that + FcPatternGetRange is available. */ + FcRange *range; + if (FcPatternGetRange (p, FC_WEIGHT, 0, &range) == FcResultMatch + && FcPatternGetBool (p, FC_VARIABLE, 0, &b) == FcResultMatch + && b == FcTrue) + return Qnil; +#endif /* FC_VARIABLE */ file = (char *) str; key = Fcons (build_unibyte_string (file), make_fixnum (idx)); @@ -863,6 +881,9 @@ ftfont_list (struct frame *f, Lisp_Object spec) #if defined HAVE_XFT && defined FC_COLOR FC_COLOR, #endif +#ifdef FC_VARIABLE + FC_VARIABLE, +#endif /* FC_VARIABLE */ NULL); if (! objset) goto err; -- 2.30.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 12 09:56:58 2022 Received: (at 52888-done) by debbugs.gnu.org; 12 Jan 2022 14:56:58 +0000 Received: from localhost ([127.0.0.1]:58538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7f3a-0001EK-3u for submit@debbugs.gnu.org; Wed, 12 Jan 2022 09:56:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7f3W-0001Dz-E2 for 52888-done@debbugs.gnu.org; Wed, 12 Jan 2022 09:56:56 -0500 Received: from [2001:470:142:3::e] (port=47526 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7f3R-00051Q-2G; Wed, 12 Jan 2022 09:56:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=89Jx4x4Y3ZQd8EpL87thX5JK8rGh5XsBUjcVFTvjCbs=; b=jZVy8fedoP6e +uFZUWriplIE0mYuTvjYVZ1FUFtHHMAnU6na8An55cviH1d6ZEvHrvXnjvDCavtVb8HpD4TKnGiyi L7X1/Iak5qUakEl3YQhGdbn/dnt7IDFSCWYlmTjwUgCiyvfdQwi2OZ1SgIvCHEaIvuAYYM2lFaUZx a29iJU6BKsWMdmLJkQ/czVVYmwYi5SoCRQEfrRGbeLydpT45hnVC1e6Qog1NPLC3DPY/QFt3JUp9V RfZqZs4DzyRbYi5k4bhEMz9l/+n4RIkKAEjAv0TN7PZswxxf82jaJLzXMbLXQqBs8XdYl8MZSkZJt SmFCHn2bU8nAOSg0R5mW1A==; Received: from [87.69.77.57] (port=1789 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7f3Q-0004vL-FE; Wed, 12 Jan 2022 09:56:49 -0500 Date: Wed, 12 Jan 2022 16:56:44 +0200 Message-Id: <83k0f557f7.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87pmp4d9bv.fsf@melete.silentflame.com> (message from Sean Whitton on Thu, 06 Jan 2022 11:10:12 -0700) Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX References: <87czl55skc.fsf@melete.silentflame.com> <83a6g982tt.fsf@gnu.org> <87pmp4d9bv.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888-done Cc: 52888-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: 52888@debbugs.gnu.org > Date: Thu, 06 Jan 2022 11:10:12 -0700 > > > OK, but (a) we need a comment there explaining why FC_VARIABLE is used > > as the condition, and (b) we'd also need to merge the temporary fix in > > font.c to master. > > Here's an updated patch. I don't think I can help with (b) but let me > know if there's something I can do. Thanks, I installed this, and also installed a followup change that is the "temporary fix" from emacs-28 adapted to the code on master. And with that, I'm closing this bug. Thanks for working on this. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 12 16:41:42 2022 Received: (at 52888) by debbugs.gnu.org; 12 Jan 2022 21:41:42 +0000 Received: from localhost ([127.0.0.1]:59341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7lNG-0001Mi-E3 for submit@debbugs.gnu.org; Wed, 12 Jan 2022 16:41:42 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:35743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7lNF-0001MV-6E for 52888@debbugs.gnu.org; Wed, 12 Jan 2022 16:41:41 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 18E425C013A; Wed, 12 Jan 2022 16:41:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 12 Jan 2022 16:41:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=pd1MxD11k7v/ZIsZG1v2Lf2IgV kbMScYI5M7aKyS7cU=; b=R05vkPkAFTQguH16JzugNVWPLjGunheIOq2fL4Zsy6 bRFg08Es6rGRVuFYth8T7vAOxIk0MqiUur+sEcOnX5Km6JGenioXVZwUVyQVGIX4 oV5xFjb/jQUwommASLND65Fe9yagcc4wrSFHOuxOm9yUX+VP1wSy3V0quXwoo85l Y1JXiL4Rky+4rLZBJ++XtEJluYcq4cSJ6FM0edkD9w5WXoT+pgz/VEvtIxMYxmdT nrRBcPHXatdn0/ucjEyxNn+H9T8m8VpGPfX3BLy3Np1m5759vusELTYPuLmH9o8P A48apILZpAjQDVZICt5zdTbgIBee4JuhEbyGvOZiqkfQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=pd1MxD 11k7v/ZIsZG1v2Lf2IgVkbMScYI5M7aKyS7cU=; b=dGfaYtbNMFRf8EVPXNw09f AxWOU8Y37kLn2r9j3yVd4jEXgHb20ZpmIQdZlQvqR3fQkJsyKukKQ2eiUDbajEm6 2kXywENfeCIgq6wI4uEfN0hS0g0Qed6B1aG6Xs0+i4wcAeADt80Xcyl2lSNhXSwg p7Sv9HXMbBeJybDaiMzNPDzUvvAb83KIBO/JnBnXPiQOcNcIkPLNhq5ozzfdkuig ukkBSfEKiRDIxzshTYX9aHoX5vZFsDV6ZKB1IdwDuRR2iN1TisDWccUVKdXNNujp E1VcnXuwnwKRTuoZjqUfsTtsTX18n8z1LoGMLT7N8Yhb0wjJbrdJ4EXEk1p0B5TQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrtddugdduvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhepleeggefgvdeijedvhfdugfegtefgkeekueeileejjeehudeg geefteeghfeuffeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Jan 2022 16:41:35 -0500 (EST) Received: by athena.silentflame.com (Postfix, from userid 1000) id E539C1B988A; Wed, 12 Jan 2022 21:41:33 +0000 (UTC) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX In-Reply-To: <83k0f557f7.fsf@gnu.org> References: <87czl55skc.fsf@melete.silentflame.com> <83a6g982tt.fsf@gnu.org> <87pmp4d9bv.fsf@melete.silentflame.com> <83k0f557f7.fsf@gnu.org> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Wed, 12 Jan 2022 14:41:33 -0700 Message-ID: <87pmow1vjm.fsf@athena.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Wed 12 Jan 2022 at 04:56pm +02, Eli Zaretskii wrote: >> From: Sean Whitton >> Cc: 52888@debbugs.gnu.org >> Date: Thu, 06 Jan 2022 11:10:12 -0700 >> >> > OK, but (a) we need a comment there explaining why FC_VARIABLE is used >> > as the condition, and (b) we'd also need to merge the temporary fix in >> > font.c to master. >> >> Here's an updated patch. I don't think I can help with (b) but let me >> know if there's something I can do. > > Thanks, I installed this, and also installed a followup change that is > the "temporary fix" from emacs-28 adapted to the code on master. Thank you for reviewing and installing. The temporary fix can't do any harm, I suppose, but it is not clear to me why it is necessary -- fontconfig doesn't generate the virtual/meta FcPatterns in versions older than 2.12.91. Sorry if I didn't make that clearer earlier, or if I am missing some other reason why it is necessary. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 13 01:53:06 2022 Received: (at 52888) by debbugs.gnu.org; 13 Jan 2022 06:53:06 +0000 Received: from localhost ([127.0.0.1]:59827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7tyr-0006oj-NB for submit@debbugs.gnu.org; Thu, 13 Jan 2022 01:53:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7tyq-0006o9-8p for 52888@debbugs.gnu.org; Thu, 13 Jan 2022 01:53:04 -0500 Received: from [2001:470:142:3::e] (port=38346 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7tyi-0000hF-4U; Thu, 13 Jan 2022 01:52:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Cjg3OLBdnzP4ia6htPQBIHSu9Lx2wEkmaa9EcMSMfKA=; b=h68IwDhMPt1T 38AM8ixVhaa98QepZGHiAu1IyK55CJW2K+uvvUykTkPk3d0udcUkZyhIMmSXoZIsCBlbS7EFdPEUH 8NFjH0y7E7GMu99VzI9yiACPMtmfRs1KfR/9DxG5WvU4aLRHjHbuYT1hEkvry4pQ3gyvKntBlbxMo xGV3GpK3RzilCsdgBtrExJrZP3VW8p6XRo32gPG9A7RXGHDkhtxqGPlE3Q/WRIqAy1orGJdX83cBL RiBpCofGiPB9pWvhOwF/aSd1KynBzxDqq/lozcPytXRz4N5NcdbOu+n9noRFOtG2eRxzNFaN/ZNWd jRjpPKPG7HPU3/FRZ+2N9A==; Received: from [87.69.77.57] (port=4633 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7tyD-0002T7-8o; Thu, 13 Jan 2022 01:52:45 -0500 Date: Thu, 13 Jan 2022 08:52:22 +0200 Message-Id: <83k0f43z6h.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87pmow1vjm.fsf@athena.silentflame.com> (message from Sean Whitton on Wed, 12 Jan 2022 14:41:33 -0700) Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX References: <87czl55skc.fsf@melete.silentflame.com> <83a6g982tt.fsf@gnu.org> <87pmp4d9bv.fsf@melete.silentflame.com> <83k0f557f7.fsf@gnu.org> <87pmow1vjm.fsf@athena.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: 52888@debbugs.gnu.org > Date: Wed, 12 Jan 2022 14:41:33 -0700 > > Hello, > > On Wed 12 Jan 2022 at 04:56pm +02, Eli Zaretskii wrote: > > >> From: Sean Whitton > >> Cc: 52888@debbugs.gnu.org > >> Date: Thu, 06 Jan 2022 11:10:12 -0700 > >> > >> > OK, but (a) we need a comment there explaining why FC_VARIABLE is used > >> > as the condition, and (b) we'd also need to merge the temporary fix in > >> > font.c to master. > >> > >> Here's an updated patch. I don't think I can help with (b) but let me > >> know if there's something I can do. > > > > Thanks, I installed this, and also installed a followup change that is > > the "temporary fix" from emacs-28 adapted to the code on master. > > Thank you for reviewing and installing. > > The temporary fix can't do any harm, I suppose, but it is not clear to > me why it is necessary -- fontconfig doesn't generate the virtual/meta > FcPatterns in versions older than 2.12.91. Sorry if I didn't make that > clearer earlier, or if I am missing some other reason why it is > necessary. Yes, you should have said that earlier. But the defensive programming in that place cannot hurt, so I will leave it there. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 13 09:55:27 2022 Received: (at 52888) by debbugs.gnu.org; 13 Jan 2022 14:55:27 +0000 Received: from localhost ([127.0.0.1]:33150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n81Ve-0003f9-L8 for submit@debbugs.gnu.org; Thu, 13 Jan 2022 09:55:27 -0500 Received: from mail-lf1-f47.google.com ([209.85.167.47]:44550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7ygO-00023A-KD for 52888@debbugs.gnu.org; Thu, 13 Jan 2022 06:54:21 -0500 Received: by mail-lf1-f47.google.com with SMTP id o15so18483805lfo.11 for <52888@debbugs.gnu.org>; Thu, 13 Jan 2022 03:54:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=IDScAhuH5Bv9SSyZGNQqSHY8zOW2QmA8w5UVAu1KBbc=; b=WZ0oYEKAbMFurGASoR9hZcrZRDSTSKzIeyr1yd7cF7B94ajWA8RSZbHZd2BZYkcGZW aOgz+ZINanps0e7a2HR7ozeGIZ5ua4ExQbK60TNMpHCSAD1Wn5dlRje83cm9onOVoPLk 1sTNQqOXGmXOFdjI1F3odGLLV3OUPe7GBSbacgvaCUSlo/YOzuxw4oRdctFMqhUjG7aX QWd8ELjsbwi/7pKDxUZwYXfIb0mZXfL8t5rlGCrHHnbirO+Pja92wvKarpa8iHMBgY+3 MTD/MnLbVF0psVvdXxenJcFRbyOGq5whkYvstwnnpEJqSXbkYupKihimbtzEIQ6r+3Cu Jr1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=IDScAhuH5Bv9SSyZGNQqSHY8zOW2QmA8w5UVAu1KBbc=; b=PK9EEM2isKD+bOFPsHPOYmaIcvxsd3HsAFqy7Z4iu6k0Ji5VCun/0h/xyhdvai/1gP AQqdqTRq8lbmk44hjAN0pIvQ3eiN7IybVV3V+UifGpOwGEQdFr+SXtw0fh7t7M9XC7vP xplAjHxqSEOB32mymgtTodwG1fWQUtaPVqNYcRRmiYpr2sIqQFt5s/HgL7Utv/AP1zDo rR+Dy2kozu+j5R6EF0PYqvZazhmAw10gYFfIX/XCG6JU+3OV187MFjlC4JF2pqHR4UNn b6E/uOuVeF9bfMsVMlQMpJYOMJmMez3sQnmSK8IYROFHyua/JLJ69jofSJtCRsvappWP ++tA== X-Gm-Message-State: AOAM530k3+s42rXuho1jnFp1X2qlL7qtvfmXuJMYaxhx9uXmjTsMvQx6 tGPxUzw7+HmJ75HYIOt58UcAsOsowWveezyl5RRgLTHFPxeHnw== X-Google-Smtp-Source: ABdhPJzBenX1vPfq0Erm1fYLm/zamdb83iWbsxC5uXVrWJt0hu0r3zEDVSqzx1NAmXRf43SIOocS5nap9PIrJWn8kEE= X-Received: by 2002:a2e:3313:: with SMTP id d19mr2717834ljc.436.1642074853884; Thu, 13 Jan 2022 03:54:13 -0800 (PST) MIME-Version: 1.0 From: =?UTF-8?B?QW5kcsOpIFNpbHZh?= Date: Thu, 13 Jan 2022 11:54:02 +0000 Message-ID: Subject: bug#52888 To: 52888@debbugs.gnu.org Content-Type: multipart/mixed; boundary="0000000000005c6be105d5755819" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 52888 X-Mailman-Approved-At: Thu, 13 Jan 2022 09:55:25 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000005c6be105d5755819 Content-Type: multipart/alternative; boundary="0000000000005c6bdf05d5755817" --0000000000005c6bdf05d5755817 Content-Type: text/plain; charset="UTF-8" FWIW the patch included in emacs-28.0.91 seems to lead to a regression for me where the incorrect font is used in certain cases or maybe just some font attributes are not applied (e.g. in the modeline). The attached patch fixes the problem for me. --0000000000005c6bdf05d5755817 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
FWIW the patch included in=C2=A0emacs-28.0.91 seems to lea= d to a regression for me where the incorrect font is used in certain cases = or maybe just some font attributes are not applied (e.g. in the modeline). = The attached patch fixes the problem for me.


<= /div> --0000000000005c6bdf05d5755817-- --0000000000005c6be105d5755819 Content-Type: text/x-patch; charset="US-ASCII"; name="emacs-fix-font.patch" Content-Disposition: attachment; filename="emacs-fix-font.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kycwxoyb0 ZGlmZiAtLWdpdCBhL3NyYy9mb250LmMgYi9zcmMvZm9udC5jCmluZGV4IDU2YTkyMWRhOS4uNjRk ZDEyYWJjIDEwMDY0NAotLS0gYS9zcmMvZm9udC5jCisrKyBiL3NyYy9mb250LmMKQEAgLTI3NTEs OSArMjc1MSw5IEBAIGZvbnRfZGVsZXRlX3VubWF0Y2hlZCAoTGlzcF9PYmplY3QgdmVjLCBMaXNw X09iamVjdCBzcGVjLCBpbnQgc2l6ZSkKIAl9CiAgICAgICBmb3IgKHByb3AgPSBGT05UX1dFSUdI VF9JTkRFWDsgcHJvcCA8IEZPTlRfU0laRV9JTkRFWDsgcHJvcCsrKQogCWlmIChGSVhOVU1QIChB UkVGIChzcGVjLCBwcm9wKSkKLQkgICAgJiYgISAoRklYTlVNUCAoQVJFRiAoZW50aXR5LCBwcm9w KSkKLQkJICAmJiAoKFhGSVhOVU0gKEFSRUYgKHNwZWMsIHByb3ApKSA+PiA4KQotCQkgICAgICA9 PSAoWEZJWE5VTSAoQVJFRiAoZW50aXR5LCBwcm9wKSkgPj4gOCkpKSkKKwkgICAgJiYgRklYTlVN UCAoQVJFRiAoZW50aXR5LCBwcm9wKSkKKwkgICAgJiYgKChYRklYTlVNIChBUkVGIChzcGVjLCBw cm9wKSkgPj4gOCkKKwkJIT0gKFhGSVhOVU0gKEFSRUYgKGVudGl0eSwgcHJvcCkpID4+IDgpKSkK IAkgIHByb3AgPSBGT05UX1NQRUNfTUFYOwogICAgICAgaWYgKHByb3AgPCBGT05UX1NQRUNfTUFY CiAJICAmJiBzaXplCg== --0000000000005c6be105d5755819-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 13 11:41:08 2022 Received: (at 52888) by debbugs.gnu.org; 13 Jan 2022 16:41:08 +0000 Received: from localhost ([127.0.0.1]:34365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n839v-0000yz-00 for submit@debbugs.gnu.org; Thu, 13 Jan 2022 11:41:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n839p-0000yE-RG for 52888@debbugs.gnu.org; Thu, 13 Jan 2022 11:41:05 -0500 Received: from [2001:470:142:3::e] (port=48104 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n839k-0002lq-F3; Thu, 13 Jan 2022 11:40:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=WxHoZpv7CfBeU9uMjY+9cq7pk8XHYvllIic6AbvTLTc=; b=MKIBksypWm+OeKh5wsKe Vd1SooXRL7Q8jg1KV3JkmgiSYHb3YcXUgQy7LZcI/lgSRe90y7qz2WPx2n7j8NOlIegVk6VlZi8WA MANCPklZcs5B6+SeGki1XnJobVHn/JYOj+POWnDykLMGoOx6y9zQt90eSY0+Spxeb23ao8KNVCARt mNWzciUL3To+Muee1BJSyKclMJuMueNfw3IYDN1h/4nuv5lCNguPw1BdJKdFFQMrUqJPUVEBhozzS QDZGnl+l3LkvFg/nrTyxeqsivn3lL69TBu3J3dHv+VueSAMFFW/VqStoWsTs0sCJWnVUNdLoG+u03 WqlIGvfKFyQJMA==; Received: from [87.69.77.57] (port=4930 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n839k-00069v-BR; Thu, 13 Jan 2022 11:40:56 -0500 Date: Thu, 13 Jan 2022 18:40:54 +0200 Message-Id: <83czkv37xl.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?Andr=C3=A9?= Silva In-Reply-To: (message from =?utf-8?Q?Andr=C3=A9?= Silva on Thu, 13 Jan 2022 11:54:02 +0000) Subject: Re: bug#52888: References: <87zgoi8xve.fsf@melete.silentflame.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: André Silva > Date: Thu, 13 Jan 2022 11:54:02 +0000 > > FWIW the patch included in emacs-28.0.91 seems to lead to a regression for me where the incorrect font is > used in certain cases or maybe just some font attributes are not applied (e.g. in the modeline). The attached > patch fixes the problem for me. Do you have a test case where the problem happens? From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 13 13:13:28 2022 Received: (at 52888) by debbugs.gnu.org; 13 Jan 2022 18:13:28 +0000 Received: from localhost ([127.0.0.1]:34554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n84bI-0003rW-9c for submit@debbugs.gnu.org; Thu, 13 Jan 2022 13:13:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n84bF-0003rE-9d for 52888@debbugs.gnu.org; Thu, 13 Jan 2022 13:13:27 -0500 Received: from [2001:470:142:3::e] (port=50144 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n84b8-00024N-T9; Thu, 13 Jan 2022 13:13:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=lG3U0Kb+em5sDfgtVr4p82VIGSSbkcGOVZ7hsulgBNI=; b=jHuunV8boXEV31vyi200 CSwUt43I2STsKD7q5KLXyTQOT/xAyqv3+8cexrjP5oO/xtEhjwec46/dKs4krvrN6Afc5zD7f6dhX ylJqBp1eHefTK1G7wkpTDvWee25wLf/czdc+otQ8MUYjL8cMFsz9cHU2HJEofZt9pyrWiqyZe7PHw +ft6zNhC0DDYEtuqll2aWdHqEm70RKEenJwBbUbVOH6sWNG57vfNbj5JYbAild9njVG12kPo4ilcX qybT9exFJhliLzm1snkmVI4CDjTKU8Cm5DjdTVdJ4ow2d8sDPdpzxldBP1R+INS2PGF1qxsUGle63 X6Xqf37cwPR58Q==; Received: from [87.69.77.57] (port=2640 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n84b8-0007Zj-T4; Thu, 13 Jan 2022 13:13:19 -0500 Date: Thu, 13 Jan 2022 20:13:16 +0200 Message-Id: <83bl0f33nn.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?Andr=C3=A9?= Silva In-Reply-To: (message from =?utf-8?Q?Andr=C3=A9?= Silva on Thu, 13 Jan 2022 17:04:34 +0000) Subject: Re: bug#52888: References: <87zgoi8xve.fsf@melete.silentflame.com> <83czkv37xl.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [Please use Reply All to keep the bug tracker on the CC list.] > From: André Silva > Date: Thu, 13 Jan 2022 17:04:34 +0000 > > I don't, and I'm using doom-emacs so creating a minimal test case would take some effort (and probably > also depends on the font I'm using). That said if you look at the fix you committed if `FIXNUMP (AREF (entity, > prop))` returns false then the rest of the expression will get short-circuited (since it's an &&) and we will > negate the result therefore entering the if statement. I believe this is contrary to what we want. No, I think that's exactly what we want: fonts for which the attribute is not a number should be ignored. Your change will cause Emacs to use them, right? From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 13 14:49:14 2022 Received: (at 52888) by debbugs.gnu.org; 13 Jan 2022 19:49:14 +0000 Received: from localhost ([127.0.0.1]:34660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n865y-0006kb-IO for submit@debbugs.gnu.org; Thu, 13 Jan 2022 14:49:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n865w-0006kM-C9 for 52888@debbugs.gnu.org; Thu, 13 Jan 2022 14:49:14 -0500 Received: from [2001:470:142:3::e] (port=51930 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n865q-0007oL-LE; Thu, 13 Jan 2022 14:49:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=l9o6KsOLTbHZRoYsZFHQw5ZMtp3pDegXH+EwelAKuJQ=; b=hdatjV37HFD/XsOIwUMo F2QPbEe4ag7wrrCKvQLsU9J0LWPNvn+vBtsve/UMICqtBNDEkWIAM9/iSSJjBDdDEtzf/wQVbPFbs rofMlVg/Q+A/KUXhSbRlb2OmVRmZZkxtWmBX2cryCKpZOMa5FOkltpZLQEHDrz9bNLQqxrYR1D5sk fOSw1ubYHW+p7BqYc6ZHQs3azXpLW97aazLGVUiQ8SIoDqrsk0UW5jrraZXd+Rr/qqGJBa/6xZSv7 TfxqZ+gMmo/wq9CLnw3E/QrHqwGtU537awDj2fVNTRJlZkXu75N4ex4XAQANqgGNJiYxKKS8lptcd Xrz90zex+XUcsA==; Received: from [87.69.77.57] (port=4480 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n865q-00062T-Nl; Thu, 13 Jan 2022 14:49:07 -0500 Date: Thu, 13 Jan 2022 21:49:04 +0200 Message-Id: <83a6fz2z7z.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?Andr=C3=A9?= Silva In-Reply-To: (message from =?utf-8?Q?Andr=C3=A9?= Silva on Thu, 13 Jan 2022 18:20:20 +0000) Subject: Re: bug#52888: References: <87zgoi8xve.fsf@melete.silentflame.com> <83czkv37xl.fsf@gnu.org> <83bl0f33nn.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52888 Cc: 52888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [Forwarding to the bug tracker. Please use Reply All.] > From: André Silva > Date: Thu, 13 Jan 2022 18:20:20 +0000 > > OK then maybe my expectations were wrong. My change restores the visual behavior I was seeing before > these font attributes checks were introduced (but maybe it was wrong to begin with). It seems that now in > certain places different font styles are being used (they seem to be thinner in some places although I'm not > 100% sure whether it's the same font or not). The font I am using is JetBrains Mono. I am sorry for the > noise, as the behavior changed I just assumed that this was buggy. Since I am not providing much > information I understand that this is not entirely actionable right now so feel free to ignore it. Thanks. From unknown Sun Jun 15 08:42:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 11 Feb 2022 12:24:13 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator