From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX Date: Fri, 31 Dec 2021 17:30:35 -0700 Message-ID: <87v8z4mh5g.fsf@melete.silentflame.com> References: <87zgoi8xve.fsf@melete.silentflame.com> <83r19uim2q.fsf@gnu.org> <871r1uyq1i.fsf@athena.silentflame.com> <8335mahr8f.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18523"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) To: Eli Zaretskii , 52888@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 01 01:31:25 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n3SIt-0004ct-Jw for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Jan 2022 01:31:25 +0100 Original-Received: from localhost ([::1]:39760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3SIr-0001Oo-23 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 Dec 2021 19:31:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3SIY-0001OP-NE for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2021 19:31:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46051) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n3SIY-0000RN-B8 for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2021 19:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n3SIY-0006fJ-8N for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2021 19:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Jan 2022 00:31:02 +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.164099704525593 (code B ref 52888); Sat, 01 Jan 2022 00:31:02 +0000 Original-Received: (at 52888) by debbugs.gnu.org; 1 Jan 2022 00:30:45 +0000 Original-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 Original-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 Original-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) Original-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: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 31 Dec 2021 19:30:36 -0500 (EST) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id 1B0E67F7B85; Fri, 31 Dec 2021 17:30:35 -0700 (MST) In-Reply-To: <8335mahr8f.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:223488 Archived-At: 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