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?

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.