1

I want to use different fonts for different languages, for example, Consolas for Latin characters and Microsoft YaHei for Chinese characters. I can do this by M-x customize-face RET default and changing the default fontset for han script specifically:

(set-fontset-font "fontset-default" 'han (font-spec :family "Microsoft YaHei" :size 15))

However, this will affect all Chinese characters everywhere. I want to use a different size for Chinese characters in Org tables. After much researching I tried creating a fontset for the org-table face's font family as it is said in info:elisp#Fontsets that you can use a fontset name in place of a font name when you specify the font for a frame or a face. So this should be done by running the following:

(create-fontset-from-fontset-spec "-outline-Consolas-normal-normal-normal-mono-15-*-*-*-c-*-fontset-orgtable")
(set-fontset-font "fontset-orgtable" 'han (font-spec :family "Microsoft YaHei" :size 16))

Then M-x customize-face RET org-table. Change the Font Family field to fontset-orgtable. But this doesn't work. Or maybe it's due to my misunderstanding of how to create and use a fontset. So what is the correct way to do this?

2
  • based on this question emacs.stackexchange.com/questions/41424/… it seems you should be able to change font size per font, and in my case my chinese characters seem to use a different font (do M-x what-cursor-position C-u RET), but I don't know how to set font specifically for the given font, which for me is -GOOG-Noto Sans CJK KR-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1
    – Caleb Jay
    Sep 29 at 20:50
  • it may be worth investigating develop.spacemacs.org/layers/+intl/chinese/README.html as well but it doesn't seem to do what i want
    – Caleb Jay
    Sep 29 at 20:53

Your Answer

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

Browse other questions tagged or ask your own question.