1

For example this: 𝔱𝔢𝔰𝔱

Emacs displays it like this:
enter image description here
I have noticed this just after a Windows update this morning (now version is 1903). I remember it was working well a few days ago. I tried emacs -Q to not load any of my init files and the problem is still there.
I have another PC which is runninig Windows 1809, and on that PC it works correctly even if I run emacs -Q. And on that PC if I place cursor at the 1st char of my example and do C-u C-x = I can see the font is uniscribe:-outline-Cambria-normal-normal-normal-serif-13-*-*-*-p-*-iso10646-1 (#x967), so how does emacs know to use that font? and how come emacs on my new PC doesn't do that?
I'm using emacs 26.2 on both PCs.
What could be the problem?

1

The font you are using cannot display those particular characters. Try a different font.

(You likely see those boxes for some, but not for all, characters.)

Try also, and first, if you haven't already, starting Emacs using emacs -Q (no init file), to eliminate any possible complications coming from your init file.

  • Thanks for your reply. But how come on my old PC emacs is able to find a suitable font automatically? On that PC, if I place cursor on the 1st char of 𝔱𝔢𝔰𝔱, then press C-u C-x =, I get this font uniscribe:-outline-Cambria-normal-normal-normal-serif-13-*-*-*-p-*-iso10646-1 (#x967) – David Dai Oct 10 at 3:34
  • I just did emacs -Q on the old PC, it just works in there. And it just doesn't on the new PC. I just would like to understand more on how this works. Appreciate your help. – David Dai Oct 10 at 3:41
  • Is the same font, which works in the old PC, also installed on the new one? If not, install it. But first, just try to use another font (with the new PC). And say whether, with the insufficient font, you see those boxes for only some chars or for all chars. – Drew Oct 10 at 15:23
  • I have actually verified that, both PCs have that font installed. Something interesting I've noticed, on the new PC, if I paste my example into a Word document, the font automatically becomes "Cambria Math", if I try to change the font it wouldn't work. It's like that is the only font that can display my example. It looks like Emacs on my old PC is doing the same thing, it automatically chooses the only font that can display 𝔱𝔢𝔰𝔱. How is emacs doing this on the old PC but on the new one? could it be a windows related issue? – David Dai Oct 10 at 22:39
1

I executed the following elisp code and the problem was fixed:

(set-fontset-font "fontset-default"
                  'unicode
                  '("Cambria Math" . "iso10646-1"))

But I don't understand why on my old PC emacs is able to display 𝔱𝔢𝔰𝔱 without any configuration at all (emacs -Q).
If someone can help me understand why on one PC above code is not need while on another PC it is needed, I'd appreciate it.

0

Font Suggestion

A great programming font that has all the characters needed to show up in every tool I've run across and use including emacs is: MesloLGS NF. It is already patched for Windows (I ran across it being used in an advanced ZSH theme - Powerlevel10k) and might be one to try for comparison?

I've tried most of the other Nerd Fonts and always ran into issues with characters missing here and there. But not this one:

Meslo Nerd Font

Download these four ttf files:

  • Thanks for your answer. Now what i'm curious about is how emacs is able to automatically choose suitable font on my old pc. I've tried emacs -Q on both PC, and it just magically works on the old one. – David Dai Oct 10 at 4:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.