3

I put some unicode text in a buffer and it looks like this:

enter image description here

But if I move to that box and run M-x describe-char I see it rendered correctly at the bottom, next to "decomposition". So, Emacs has the font. How do I get to render correctly in the normal buffer, and at the top of the describe-char info (2nd line)?

The character in this case is the KANGXI RADICAL BAMBOO: ⽵.

I'm on Windows 11. Emacs version: 29.2.

2 Answers 2

2

竹 (CJK IDEOGRAPH-7AF9) is a different character than ⽵ (KANGXI RADICAL BAMBOO). You apparently don’t have a font that supplies a glyph for the latter, but you do for the former. Install better fonts.

6
  • My system has the fonts. Other programs (eg, Notepad, Wordpad) display a string with that that character. Maybe there is a way to tell Emacs to use a certain font for certain Unicode code points, if there are no glyphs for them in its default face? Commented Jul 15, 2024 at 16:04
  • It already falls back to any other font on the system if it cannot find a glyph in your default font. You don't have a font with a glyph for the radical character, but your fonts do have a glyph for the ideograph character. Commented Jul 15, 2024 at 16:44
  • Try installing the Google Noto Serif family of fonts - when I do C-u C-x = on the ⽵ (KANGXI RADICAL BAMBOO) (0x2f75), I get the following: display: by this font (glyph code): ftcrhb:-GOOG-Noto Serif CJK JP-bold-normal-normal-*-22-*-*-*-*-0-iso10646-1 (#x738A) - note that the corresponding output in your question says: display: no font available which (I think) is an indication that no font that Emacs knows about contains a glyph for that character. BTW, please don't use images where a text display suffices. Commented Jul 16, 2024 at 2:41
  • I have Noto Sans SC (Simplified Chinese) from the Google fonts site. That has a glyph for the Unicode character, and yet emacs is not using it - it still says display: no font available. I'll try the Noto Serif Simplified Chinese too and report back if it's any different, but I don't see why it would use that, if not using the first. About the images - I'm asking about display, and in both cases if I paste the text it will display differently here in the browser than what is showing on the screen in Emacs. So they seem appropriate for this question. (?) Commented Jul 17, 2024 at 13:14
  • @db48x Here's why I think my font has the U+2F75 character. I open the "Character Map" app on Windows, select "Noto Sans SC", and scroll down in the list to 2F75. It shows the glyph. I can hover over it, and it shows that Unicode code point number. And this isn't the only font on my system that shows a glyph for that code point. Commented Jul 17, 2024 at 13:32
0

The character in the decomposition sequence is rendered by the Emacs composition engine. To enable the engine manually via the composition-function-table for example for the Unicode range U+3000..U+9FFF you can add the following expression to your init file and enable global-auto-composition-mode.

(set-char-table-range composition-function-table '(#x3000 . #x9FFF) '([nil 0 font-shape-gstring])) 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.