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#71025: set-fontset-font doesn't show some scripts as glyphless characters Date: Sat, 18 May 2024 10:57:30 +0300 Message-ID: <86ed9zft79.fsf@gnu.org> References: <87o7938xti.fsf@rodrigomorales.site> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31719"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71025@debbugs.gnu.org To: Rodrigo Morales Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 18 09:58: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 1s8ExO-0007yF-0e for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 May 2024 09:58:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8Ex8-0003Ve-8E; Sat, 18 May 2024 03:58:02 -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 1s8Ex5-0003VL-H7 for bug-gnu-emacs@gnu.org; Sat, 18 May 2024 03:57: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 1s8Ex4-0005A1-Mm for bug-gnu-emacs@gnu.org; Sat, 18 May 2024 03:57:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s8Ex7-0007AS-Rv for bug-gnu-emacs@gnu.org; Sat, 18 May 2024 03:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 May 2024 07:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71025 X-GNU-PR-Package: emacs Original-Received: via spool by 71025-submit@debbugs.gnu.org id=B71025.171601907727546 (code B ref 71025); Sat, 18 May 2024 07:58:01 +0000 Original-Received: (at 71025) by debbugs.gnu.org; 18 May 2024 07:57:57 +0000 Original-Received: from localhost ([127.0.0.1]:60131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8Ex2-0007AE-MD for submit@debbugs.gnu.org; Sat, 18 May 2024 03:57:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8Ewt-0007A6-QL for 71025@debbugs.gnu.org; Sat, 18 May 2024 03:57:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8Ewi-00057A-6l; Sat, 18 May 2024 03:57:37 -0400 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=x5Hkatnu15ILJlthCyuxhXcvhCGS8Ua7ide8CXydDTs=; b=K1MllcbY1Mj9QQsZgQhI 6aO4LfBr7hCVsX+wZRoc6sA9Wzpc2R9AdRQLpuuZXwKhyODpssB3VKkdGmvALV+TAfFZE9BuWX70k OVP4I+ggfyZS7I2zBc4TPLbrKYZT2LTXdAAqlysbejGEwwloPOuKy/g+gzwCxC10o9umgid+t04sp 9CxbmdZ4Oyysq1D/fNw/a3sUpwXW876fEyANeLagqi2knPfZSdpj0XvUsHbGGXU/lrfp7H6O4EoUw cYPcn2e219sgyUGXTD3qpoB20SIZL0JuKCYSk9q0IQQpdC/X6HY+2zWPHmAPRSF1WAH7gp7+mNXva sV26pAiVux+6XA==; In-Reply-To: <87o7938xti.fsf@rodrigomorales.site> (message from Rodrigo Morales on Sat, 18 May 2024 00:59:37 -0500) 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:285284 Archived-At: > From: Rodrigo Morales > Date: Sat, 18 May 2024 00:59:37 -0500 > > > I need characters from specific scripts to be shown as glyphless > characters (i.e. hexadecimal codes inside boxes). In [[1][this message]], > Eli Zaretskii cited the docstring of set-fontset-font (relevant part > shown in QUOTE block below) to backup the suggestion that if I wanted to > display Amharic and Chinese characters as glyphless characters, I should > call =set-fontset-font= with =CHARACTERS= equal to =nil=. > > #+BEGIN_QUOTE > CHARACTERS may be nil. In that case, use FONT-SPEC for any character for > which no font-spec is specified in FONTSET." > #+END_QUOTE > > I tried Eli's suggestion. However, this didn't make the characters from > all of the specified scripts to be shown as hexadecimal codes inside > boxes. I explain how I reproduced the issue in the lines below. > > I emptied =~/.config/emacs/init.el= and inserted the following sexps > into that file. > > #+HEADER: :tangle ~/.config/emacs/init.el > #+BEGIN_SRC elisp > (set-fontset-font t 'brahmi nil) > (set-fontset-font t 'egyptian nil) > (set-fontset-font t 'ethiopic nil) > (set-fontset-font t 'tagbanwa nil) > (set-fontset-font t 'han nil) > #+END_SRC > > I created the file =/tmp/a.txt= with the following content > > #+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 (๐‘€ฉ๐‘†๐‘€ญ๐‘€ธ๐‘€ณ๐‘†๐‘€ซ๐‘€ป) ๐‘€ฆ๐‘€ซ๐‘€ฒ๐‘†๐‘€ข๐‘‚ > Egyptian Hieroglyphs (๐“‚‹๐“ค๐“ˆ–๐“†Ž๐“…“โ€Œ๐“๐“Š–) ๐“…“๐“Šต๐“๐“Šช, ๐“‡๐“‡‹๐“‚ป๐“˜๐“‡‹ > Amharic (แŠ แˆ›แˆญแŠ›) แˆ แˆ‹แˆ > Tagbanwa (แฆแชแฏ) แซแฉแฌแฅ แฃแฎแงแฏ > Chinese (ไธญๆ–‡,ๆ™ฎ้€š่ฏ,ๆฑ‰่ฏญ) ไฝ ๅฅฝ > #+END_SRC > > I launched Emacs by running =$ emacs= in a terminal emulator. I didn't > use the =-Q= flag so that =~/.config/emacs/init.el= is read. > > I evaluated =(find-file "/tmp/a.txt")=, and I could see that > hexadecimal codes in a box were shown for the Brahmi and Egyptian > Hieroglyphs characters. This is expected behavior. However, the > Amharic, Tagbanwa and Chinese characters weren't shown as hexadecimal > codes inside a box but instead they were shown using other fonts. This > is unexpected behavior. I called =describe-char= in the first > character of each line to see which font is used for each script. > > + Brahmi: no font available > + Egyptian Hieroglyphs: no font available > + Amharic: ftcrhb:-GOOG-Noto Sans > Ethiopic-regular-normal-normal-*-12-*-*-*-*-0-iso10646-1 (#x2B) > + Tagbanwa: ftcrhb:-GOOG-Noto Sans > Tagbanwa-regular-normal-normal-*-12-*-*-*-*-0-iso10646-1 (#x12) > + Chinese: ftcrhb:-GOOG-Noto Sans CJK > KR-regular-normal-normal-*-12-*-*-*-*-0-iso10646-1 (#x2703) > > Just to make it clear, to me the behavior that actually honours the > docstring of =set-fontset-font= is that the characters from the > scripts in the file =/tmp/a.txt= are shown as hexadecimal codes inside > boxes. I cannot reproduce this. On my system, those 5 lines in the init file show all the scripts in a.txt as hexadecimal codes. Do you have site-init files in your Emacs installation? Or some early-init file? Maybe something other than the init file is affecting this. Otherwise, I have no idea why this doesn't work for you, as it does for me.