From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rodrigo Morales Newsgroups: gmane.emacs.bugs Subject: bug#70993: set-fontset-font doesn't use specified font for some scripts Date: Sat, 18 May 2024 01:17:33 -0500 Message-ID: <87mson8wzm.fsf@rodrigomorales.site> References: <4adb892bae445f61388156a41e4a0d65@rodrigomorales.site> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1891"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70993@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 18 08:18:19 2024 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 1s8DOc-0000IN-Si for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 May 2024 08:18:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8DOL-0000cx-5p; Sat, 18 May 2024 02:18:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8DOI-0000bx-Vn for bug-gnu-emacs@gnu.org; Sat, 18 May 2024 02:17:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s8DOI-00021M-Me for bug-gnu-emacs@gnu.org; Sat, 18 May 2024 02:17:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s8DOL-00035J-T5 for bug-gnu-emacs@gnu.org; Sat, 18 May 2024 02:18:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <4adb892bae445f61388156a41e4a0d65@rodrigomorales.site> Resent-From: Rodrigo Morales Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 May 2024 06:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70993 X-GNU-PR-Package: emacs Original-Received: via spool by 70993-submit@debbugs.gnu.org id=B70993.171601306911847 (code B ref 70993); Sat, 18 May 2024 06:18:01 +0000 Original-Received: (at 70993) by debbugs.gnu.org; 18 May 2024 06:17:49 +0000 Original-Received: from localhost ([127.0.0.1]:59480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8DO9-000351-65 for submit@debbugs.gnu.org; Sat, 18 May 2024 02:17:49 -0400 Original-Received: from smtpout1.mo11.mail-out.ovh.ca ([51.161.45.253]:57715) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8DO1-00034s-LW for 70993@debbugs.gnu.org; Sat, 18 May 2024 02:17:48 -0400 Original-Received: from mxplan1.mail.ovh.ca (unknown [10.111.58.225]) by mo11.mail-out.ovh.ca (Postfix) with ESMTPS id 4VhDC50vWczHpwL; Sat, 18 May 2024 03:17:36 -0300 (ADT) Original-Received: from rodrigomorales.site (54.39.251.56) by DAG2EX1.mxpca1.local (172.16.2.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 18 May 2024 02:17:35 -0400 Authentication-Results: garm.ovh; auth=pass (GARM-94B0011d3d9daa-8b2d-47a0-9a4d-0a5d50ff3d05, 5AF320D84855DAA5253F528CE2042937A6D8771F) smtp.auth=me@rodrigomorales.site X-OVh-ClientIp: 190.232.101.8 X-Originating-IP: [54.39.251.56] X-ClientProxiedBy: DAG1EX1.mxpca1.local (172.16.2.1) To DAG2EX1.mxpca1.local (172.16.2.11) X-Ovh-Tracer-GUID: ff8ad0d4-7145-48e8-81b9-c0ef2eb293b3 X-Ovh-Tracer-Id: 5188146772797365914 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdehhedguddtgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfggtgfgihesthhqredttddtjeenucfhrhhomheptfhoughrihhgohcuofhorhgrlhgvshcuoehmvgesrhhoughrihhgohhmohhrrghlvghsrdhsihhtvgeqnecuggftrfgrthhtvghrnhepueffjeekhfffvdevveehheejgfetteelteduteduleegfeeileffueefuedvkefgnecuffhomhgrihhnpegrrhgthhhivhgvrdhorhhgpddtgidtrdhsthenucfkphepuddvjedrtddrtddruddpheegrdefledrvdehuddrheeipdduledtrddvfedvrddutddurdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehmvgesrhhoughrihhgohhmohhrrghlvghsrdhsihhtvgdpnhgspghrtghpthhtohepvddprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopeejtdelleefsegu vggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohduuddpmhhouggvpehsmhhtphhouhht X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285276 Archived-At: Eli Zaretskii writes: > In any case, it sounds like Emacs rejects the Cozette font for some > scripts. Why that happens, I don't know, sorry. Can you set font-log > to nil before you visit your a.txt file, and then post the value of > font-log after the file is displayed? That could perhaps tell us > something about the cause of this behavior. I performed two experiments. I emptied ~/.config/emacs/init.el and inserted the sexps showed in the first code block below. The content of =3D/tmp/a.txt=3D is shown in the second code block below. #+HEADER: :tangle ~/.config/emacs/init.el #+BEGIN_SRC elisp (set-fontset-font t 'brahmi (font-spec :family "Cozette")) (set-fontset-font t 'egyptian (font-spec :family "Cozette")) (set-fontset-font t 'ethiopic (font-spec :family "Cozette")) (set-fontset-font t 'tagbanwa (font-spec :family "Cozette")) (set-fontset-font t 'han (font-spec :family "Cozette")) #+END_SRC #+HEADER: :tangle /tmp/a.txt #+BEGIN_SRC text The following lines were retrieved from the HELLO buffer which is opened by calling view-hello-file in GNU Emacs 29.3. Brahmi (=F0=91=80=A9=F0=91=81=86=F0=91=80=AD=F0=91=80=B8=F0=91=80=B3=F0=91= =81=86=F0=91=80=AB=F0=91=80=BB) =F0=91=80=A6=F0=91=80=AB=F0=91=80=B2=F0=91= =81=86=F0=91=80=A2=F0=91=81=82 Egyptian Hieroglyphs (=F0=93=82=8B=F0=93=8F=A4=F0=93=88=96=F0=93=86=8E=F0= =93=85=93=E2=80=8C=F0=93=8F=8F=F0=93=8A=96) =F0=93=85=93=F0=93=8A=B5=F0=93= =8F=8F=F0=93=8A=AA, =F0=93=87=8D=F0=93=87=8B=F0=93=82=BB=F0=93=8D=98=F0=93= =87=8B Amharic (=E1=8A=A0=E1=88=9B=E1=88=AD=E1=8A=9B) =E1=88=A0=E1=88=8B=E1=88=9D Tagbanwa (=E1=9D=A6=E1=9D=AA=E1=9D=AF) =E1=9D=AB=E1=9D=A9=E1=9D=AC=E1=9D=A5= =E1=9D=A3=E1=9D=AE=E1=9D=A7=E1=9D=AF Chinese (=E4=B8=AD=E6=96=87,=E6=99=AE=E9=80=9A=E8=AF=9D,=E6=B1=89=E8=AF=AD)= =E4=BD=A0=E5=A5=BD #+END_SRC 1. I launched =3Demacs=3D without the =3D-Q=3D flag so that =3D~/.config/emacs/init.el=3D is read. Then, I evaluated =3D(setq font-log nil)=3D. Then, I evaluated =3D(find-file "/tmp/a.txt")=3D. Brahmi and Egyptian Hieroglyphs were shown as hexadecimal codes inside boxes. Amharic, Tagbanwa and Chinese characters were shown using other fonts. Then, I evaluated =3D(describe-variable 'font-log)=3D. The content of the =3D*Help*=3D buf= fer can be found here: http://web.archive.org/web/20240518060947/http://0x0.st/XPqh.txt 2. I launched =3DEMACS_FONT_LOG=3D1 emacs=3D without the =3D-Q=3D flag so t= hat =3D~/.config/emacs/init.el=3D is read. Then, I evaluated =3D(find-file "/tmp/a.txt")=3D. Brahmi and Egyptian Hieroglyphs were shown as hexadecimal codes inside boxes. Amharic, Tagbanwa and Chinese characters were shown using other fonts. Then, I evaluated =3D(describe-variable 'font-log)=3D. The content of the =3D*Help*=3D buf= fer can be found here: http://web.archive.org/web/20240518061129/http://0x0.st/XPq7.txt > In general, the Emacs font search and the related features are > designed to find good fonts for displaying each character, whereas you > are trying to do the opposite: force Emacs to choose a font that can > NOT display characters. The doc string of set-fontset-font explains > how to set up a fontset so that certain characters have no font: use > nil for the FONT-SPEC argument. So if you want Amharic and Chinese > characters to display as glyphless characters, use this: > > (set-fontset-font t 'han nil) > (set-fontset-font t 'ethiopic nil) I tried what you suggested. However, this didn't make Amharic and Chinese characters to be shown as glyphless characters. See bug#71025. > This is indeed a limitation for someone who modifies the fontsets a > lot during a session, but unless someone submits patches to lift it, > it will remain a limitation, sorry. No problem. I will work on a patch when time allows. My initial thought was that Emacs mantainers assumed that most users don't need to call set-fontset-font in the middle of an Emacs session, so any user that tries to do this shouldn't be taken into consideration and those users need to adapt themselves to that constraint, this way of thinking goes against the goal of Emacs of being a customizable text editor. However, your last message proved my initial thoughts wrong.