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#53924: 26.1; fontification sometimes fails for some characters despite available glyphs Date: Tue, 15 Feb 2022 16:21:43 +0200 Message-ID: <83zgms2oso.fsf@gnu.org> References: <838ruitqu9.fsf@gnu.org> <834k55ub5u.fsf@gnu.org> <83k0dzq8y0.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21301"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53924@debbugs.gnu.org To: "Greg A. Woods" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 15 15:22:21 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 1nJyij-0005KC-9N for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Feb 2022 15:22:21 +0100 Original-Received: from localhost ([::1]:51134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJyii-0006Ld-AM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Feb 2022 09:22:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJyiR-0006KU-3F for bug-gnu-emacs@gnu.org; Tue, 15 Feb 2022 09:22:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJyiQ-0006gj-PY for bug-gnu-emacs@gnu.org; Tue, 15 Feb 2022 09:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJyiQ-0005E3-HF for bug-gnu-emacs@gnu.org; Tue, 15 Feb 2022 09:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Feb 2022 14:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53924 X-GNU-PR-Package: emacs Original-Received: via spool by 53924-submit@debbugs.gnu.org id=B53924.164493490820065 (code B ref 53924); Tue, 15 Feb 2022 14:22:02 +0000 Original-Received: (at 53924) by debbugs.gnu.org; 15 Feb 2022 14:21:48 +0000 Original-Received: from localhost ([127.0.0.1]:43901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJyiC-0005DY-Bz for submit@debbugs.gnu.org; Tue, 15 Feb 2022 09:21:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJyiA-0005DJ-F0 for 53924@debbugs.gnu.org; Tue, 15 Feb 2022 09:21:47 -0500 Original-Received: from [2001:470:142:3::e] (port=57440 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 1nJyi4-0006X7-TC; Tue, 15 Feb 2022 09:21:40 -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=lY9YhYIaQ76skjSzOrUIQEelM4rzhRtckqpGEdkv9s0=; b=NkUdan+VBhuY xiyyAqUxbp44v00YWssMY33pLCwj4ZlSBvklBvLYN8bMSngF90ON+awZnJOyQQzgkHtBGqPQP+GIA TZRzc+ZT4oMuH9lN7+OO6lWxsyxcZBLiXsN1r5chbe/9lJJNtwW+um6qzMifpQX5Eez+kSTi9mzj0 elNikH2rPND3bkVO5xtYQvo0dKa4TdtOsZLuq/lp8Den+nVJV0lxBuCjnKBhmpKASKrZVtZ/0cJJb 2dHjrZquPEEwQovmA7x5VGNImPMT0iN+06Kj59D8JQRfCWEqeGe3QiCpQEf3OWVwybcHxqEoeTS4D 8mJW9f3ul7DQyteks3Lh5Q==; Original-Received: from [87.69.77.57] (port=1614 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 1nJyi4-0003Xm-Af; Tue, 15 Feb 2022 09:21:40 -0500 In-Reply-To: (woods@robohack.ca) 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:226989 Archived-At: > Date: Mon, 14 Feb 2022 18:01:43 -0800 > From: "Greg A. Woods" > Cc: GNU Emacs Bug Reports <53924@debbugs.gnu.org> > > > > (font-families (cl-remove-duplicates > > > (sort (font-family-list) > > > (lambda(x y) (string> (upcase x) (upcase y)))) > > > :test 'cl-equalp))) > > > > This is not recommended as a way to get useful fonts. > > Perhaps you can explain that better or differently so I can try to > understand? Certainly. Which part(s) would you like me to explain better? > I chose font-family-list because it is (supposedly) window-system > agnostic. Indeed it works fine on macOS too, and it transparently even > does approximately the right thing on a TTY. font-family-list yields a list that includes fonts that are not necessarily appropriate for Emacs. As does x-list-fonts, if run with just one argument. > > My suggestion > > is to use the following instead: > > > > (delete-dups > > (x-list-fonts "-*-*-medium-r-normal-*-*-*-*-*-*-iso10646-1" > > 'default (selected-frame))) > > BTW, delete-dups is wrong, but I finally found seq-uniq (to avoid > cl-lib): I don't see why delete-dups would be wrong here, but that's a tangent. > (seq-uniq > (sort (font-family-list) > (lambda(x y) (string> (upcase x) (upcase y)))) > (lambda(x y) (string= (upcase x) (upcase y)))) The problem with this is that it doesn't filter out fonts that are too small for the frame, and fonts that cannot be used for the 'default' face. So the result is still unsafe. > > Indeed, using x-list-fonts indiscriminately could very well include > > fonts that Emacs cannot use or even those which will crash Emacs. > > Indeed -- that's another reason why I chose not to use x-list-fonts! But font-family-list is not better. In fact, it's worse, because it doesn't support the filtering x-list-fonts does when used with 3 arguments, and when the font XLFD pattern is set up to produce only fonts that can be safely used in Emacs for the 'default' face. > > Is this with the above Lisp program that tries all the fonts collected > > by font-family-list, or is this with some other recipe to reproduce > > the crash? Also, was that in "emacs -Q"? > > It turns out the crash happens with one font in particular, > "Inconsolata". I have some cleanup of the versions of that font in > particular that I need to do to be sure I know which one is being used. > > I can also now confirm the same crash occurs with both GTK+2.0 and with > the Lucid (xaw3d) toolkits, and in both 26.1 and today's Git "master". Can you show a simple Emacs -Q invocation with that font which crashes? Then I think I or someone else could look into the reasons.