From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX Date: Thu, 30 Dec 2021 09:33:17 +0200 Message-ID: <83r19uim2q.fsf@gnu.org> References: <87zgoi8xve.fsf@melete.silentflame.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38835"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52888@debbugs.gnu.org To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 30 08:34:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n2pwv-0009ua-P1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Dec 2021 08:34:09 +0100 Original-Received: from localhost ([::1]:51780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2pwu-00062G-DS for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Dec 2021 02:34:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2pwo-000628-9M for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 02:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2pwn-0006xq-Vt for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 02:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2pwn-0006Fw-SK for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 02:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Dec 2021 07:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52888 X-GNU-PR-Package: emacs Original-Received: via spool by 52888-submit@debbugs.gnu.org id=B52888.164084960623980 (code B ref 52888); Thu, 30 Dec 2021 07:34:01 +0000 Original-Received: (at 52888) by debbugs.gnu.org; 30 Dec 2021 07:33:26 +0000 Original-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 Original-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 Original-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==; Original-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 In-Reply-To: <87zgoi8xve.fsf@melete.silentflame.com> (message from Sean Whitton on Wed, 29 Dec 2021 22:28:37 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:223417 Archived-At: > 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.