rolandwalker/unicode-fonts

Is it possible to change certain font?

Opened this issue · 3 comments

Hi, a great package, almost all symbols are shown correctly.

I used to use https://github.com/tumashu/chinese-fonts-setup to set up Chinese fonts.
However, it cannot set symbols correctly.

But when using unicode-fonts, symbols are all right but lack two features that the above package provided:

  1. The ability to change fonts.
  2. The correct width of alignment (1 Chinese char = 2 latin char)

Is there is way to do these two functions inside this package?

Hi! Awesome link!

I really want to combine that alignment functionality into unicode-fonts.el. It's going to take me a little bit to learn it because of not knowing how to read what I am looking at. I might need help.

As for changing the fonts, yes, unicode-fonts.el lets you do that, though it is too difficult and I need to make it easier.

If you type

  • M-x customize-variable RET unicode-fonts-block-font-mapping RET

then a giant customization buffer appears that contains all the block-to-font mappings. Each block shows the order of its preferred font.

So, if you scroll down that buffer until you find block "CJK Unified Ideographs", and press the INS button next to the first item, you can add a new font in the first position. Go back to the top of the customization buffer, press the "Apply and Save" button. Now the font you entered is the preferred font for displaying "CJK Unified Ideographs".

Besides the fact that the customization buffer is too big and complicated, it can be difficult to know exactly the spelling of the font name that Emacs expects – and that spelling varies per platform. I generally just install the font, restart Emacs, and look at the output of (font-utils-list-names) to find the one I want.

If there are good Chinese fonts that are not listed inside unicode-fonts.el, let's also add those fonts to the library.

Sorry for get back to this late.
Yes the font changing process is still painful.
The fonts are provided in the file, but it need a better way to switch between them.

Is there a better way to set certain fonts other than modifying this huge alist?