all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Rodrigo Morales <me@rodrigomorales.site>
Cc: 71025@debbugs.gnu.org
Subject: bug#71025: set-fontset-font doesn't show some scripts as glyphless characters
Date: Sat, 18 May 2024 10:57:30 +0300	[thread overview]
Message-ID: <86ed9zft79.fsf@gnu.org> (raw)
In-Reply-To: <87o7938xti.fsf@rodrigomorales.site> (message from Rodrigo Morales on Sat, 18 May 2024 00:59:37 -0500)

> From: Rodrigo Morales <me@rodrigomorales.site>
> 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.





  reply	other threads:[~2024-05-18  7:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-18  5:59 bug#71025: set-fontset-font doesn't show some scripts as glyphless characters Rodrigo Morales
2024-05-18  7:57 ` Eli Zaretskii [this message]
2024-05-18  8:18   ` Eli Zaretskii
2024-05-20 16:49     ` Rodrigo Morales
2024-05-20 18:02       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ed9zft79.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71025@debbugs.gnu.org \
    --cc=me@rodrigomorales.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.