0

I had faced the similar problem earlier and found a solution myself here. But I am stumped now.

I am running Doom Emacs 3.0.0 on Emacs 27.2 on Gnome 40.4.

In my config.el, there is:

(set-fontset-font t 'devanagari "Eczar") 

I have installed Eczar font. font-counsel shows Eczar as an option. set-frame-font shows multiple Eczar entries --- I guess, one each for a variant. I can select any of these and the change is reflected immediately. I can do Options -> Set Main Font and select Eczar. And like in the previous case, the change is reflected immediately.

But that setting in config.el has no effect. I can not get only Devanagari characters to display in Eczar (or any other) font.

describe-char shows the font Gotu. I had used that earlier.

How do I solve this problem?

4
  • Does "Eczar" appear as a choice if you click on Options-> Set Default Font? If it does, can you select it? Does it work? Commented Sep 24, 2021 at 17:44
  • @NickD Thanks. Yes. It does show Eczar. It shows several variants like Eczar Regular, Medium, etc. I can select any of these. And the text changes accordingly. But that changes it for all character sets. I wanted that font only for Devanagari characters. Commented Sep 25, 2021 at 10:37
  • Yes, I meant it as a sanity check, not as a solution. Commented Sep 25, 2021 at 12:36
  • 1
    @NickD Oh OK. I will update my question to include this piece of information. Commented Sep 25, 2021 at 15:13

1 Answer 1

1
+100

You should in general do fontset changes in window-setup-hook (for normal frames) and server-after-make-frame-hook (for client frames). Therefore, I suggest that you try the following:

(defun my-customize-default-fontset () "Customize the default fontset." (set-fontset-font t 'devanagari "Eczar")) (add-hook 'window-setup-hook #'my-customize-default-fontset) (add-hook 'server-after-make-frame-hook #'my-customize-default-fontset) 
1
  • Perfect. That did the trick. Thanks!! Commented Mar 15, 2022 at 15:29

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.