0

I have attempted to setup emacs 28.2 to display color emojis using the Noto Color Emoji font. According to a "Font Manager" program (provided by font-manager Debian package), the following symbols are among the glyphs available within the Noto Color Emoji font: ↔, ↕, ↖, ↗, ↘, ↙, ↩, ↪.

I have attempted to use both

(set-fontset-font t 'symbol "Noto Color Emoji")

and

(set-fontset-font t 'emoji "Noto Color Emoji")

to configure the rendering of the symbols under consideration with the Noto Color Emoji font in Emacs buffers.

However, whenever I attempt to input them in an Emacs buffer, they end up rendered with my default font. Yet, emoji symbols like ❇ ✨ do render as expected, in full color, and with Noto Color Emoji font.

I am not sure what is the root cause of the problem. I have attempted to adopt some code suggested at the https://emacs.stackexchange.com/a/62220/40231 to setup code tables, as well as to use emojify package as suggested at the https://ianyepan.github.io/posts/emacs-emojis/. In both cases, I got the negative result. When I used emojify package, I did get a correct rendering with its internal png-based insets; after setting the

(setq emojify-display-style 'unicode)
(setq emojify-emoji-styles '(unicode))

I got the same negative (i.e. rendering with default font for some symbols) result.

Could you please suggest, what may be the root cause of the issues that I am experiencing? Could you please assist me with developing a fix?

UPDATE I attempted a following experiment. I have created the following file, then I ran emacs as emacs -Q and evaluated lines of that file:

;; ↔, ↕, ↖, ↗, ↘, ↙, ↩, ↪.

❇✨

(set-fontset-font t 'emoji "Noto Color Emoji")

(set-fontset-font t 'symbol "Noto Color Emoji")

An end result had been that only the ✨ got rendered with Noto Color Emoji font. The rest were rendered with Deja Vu Sans Mono.

UPDATE I have noticed that the problem does not occur if the text is commented, and is displayed in a corresponding face. That behaviour seems a bit weird to me, since I am not using anything more sophisticated in my face definitions than

;; ...
 '(default ((t (:inherit nil :stipple nil :foreground "white" :background "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 160 :width normal :font "Inconsolata"))))
;; ...
 '(font-lock-comment-face ((t (:background "black" :foreground "white" :distant-foreground "snow" :slant oblique :weight normal :height 160 :font "Inconsolata"))))
;; ...
5
  • Does this happen for you with emacs -Q? Your recipe works fine for me.
    – rpluim
    Mar 24, 2023 at 10:29
  • @rpluim, No, I'm not running with the -Q switch. Also, the Debian package designation is emacs-gtk 1:28.2+1-10.
    – s-t-s
    Mar 24, 2023 at 14:40
  • I've just tried that with emacs -Q on a debian-testing machine, and it all works. Do you have any local fontconfig files (see PROBLEMS, which you can reach via C-h C-p)
    – rpluim
    Mar 24, 2023 at 15:27
  • @rpluim I'm looking at the help section suggested; thank you. Would you also possibly check my UPDATE about the interaction of this issue with the comment face. That latter part seems really weird, since in the commented text I am able to achieve the desired rendering, whereas in un-commented text I could not. I assume, the fontconfig issues are related to the inability to render characters at all. In this case, it seems, the issue is more along the lines of what font the emacs chooses or fails to choose.
    – s-t-s
    Mar 24, 2023 at 15:30
  • I can't explain that: the fontset settings should override your default face (and in emacs -Q there are no such face settings, so I don't understand why it's not working for you)
    – rpluim
    Mar 24, 2023 at 15:34

1 Answer 1

0

I gave it a try and it partly worked for me. My preferred font, Input Mono Condensed, already has glyphs for two of those arrows. For the others it had to fall back to a font with a noticeably different size (almost unreadably small for some reason).

When I ran (set-fontset-font t 'symbol "Noto Color Emoji"), the fallback behavior changed and now those six arrows are displayed using the Noto Color Emoji font, while the first two are still displayed using Input Mono Condensed.

(set-fontset-font t 'emoji "Noto Color Emoji")

There’s no reason to expect this to do anything much for your test, since the arrow characters you are interested in are in the symbol script, not the emoji script.

1
  • How does your emacs behave when run with the -Q switch?
    – s-t-s
    Mar 25, 2023 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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