1

Any experts in the unicode-fonts package out there?

What I am trying to do is set the font for CJK characters and not use the default.

This seems very tough! Using the customize interface injected the usual mumbo jumbo into my .emacs file which I edited by hand to put my preferred font first in the appropriate block.

Source Han Serif SC is the font I want to use:-

'(unicode-fonts-block-font-mapping
;; blah blah
     ("CJK Compatibility"
      ("Source Han Serif SC" "SimHei" "FangSong" "SimSun" "MingLiU" "Meiryo" "Microsoft JhengHei" "Microsoft JhengHei UI" "Lantinghei SC" "Lantinghei TC" "HAN NOM A" "Arial Unicode MS" "WenQuanYi Zen Hei
;; blah blah

When Emacs reloads This change was reflected in the UI but the original font is still used for these characters.

I can get my preferred font to work if I crow bar it using set-fontset-font...

Has anybody got this to work in unicode-font?

I don't want to give up on this package because it seems very popular but there seems to be a paucity of tutorial information about it!

To illustrate this; I type the first character of the "CJK Compatibility" block: "㌀". Then type "Ctrl+U+X =" to get the character information. This is the truncated output:-

            character: ㌀ (displayed as ㌀) (codepoint 13056, #o31400, #x3300)
          charset: unicode-bmp (Unicode Basic Multilingual Plane (U+0000..U+FFFF))
          code point in charset: 0x3300
           script: han
           syntax: w    which means: word
         category: .:Base, L:Left-to-right (strong), |:line breakable
         to input: type "C-x 8 RET 3300" or "C-x 8 RET SQUARE APAATO"
          display: by this font (glyph code)
xft:-PfEd-HanaMinA-normal-normal-normal-*-42-*-*-*-d-0-iso10646-1 (#x15E3)

I would not expect the font to be HanaMinA. I would expect it to be Source Han Serif SC.

I think there is something fundamentally wrong in my understanding of how to over-ride the unicode-fonts defaults!

4
  • 1
    Which CJK characters, for example? According to en.wikipedia.org/wiki/CJK_Compatibility, CJK Compatibility contains ONLY 256 characters, however there are thousands of thousands CJK characters. – xuchunyang Apr 9 '20 at 13:18
  • thankyou xuchungyang. I have updated my question. – jolyon Apr 10 '20 at 9:51
  • I edit the source in place, put (unicode-fonts-setup) in my init file, restart Emacs, and it does work, Arial Unicode MS => Source Han Serif SC. Though I never used unicode-fonts before. It might be a good idea to ask the author directly. – xuchunyang Apr 10 '20 at 12:22
  • thanks - yes; editing unicode-fonts-block-font-mapping in the unicode-fonts.el lisp directly does indeed work. This is good enough for me! 谢谢 :) – jolyon Apr 11 '20 at 10:10

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.