Linux Fedora38中Jetbrains乱码

一、解决方案

经过“某度”的无限搜索,最终使用“某歌”查到了相关问题解答。

sudo dnf install google-noto-sans-cjk-fonts.noarch --allowerasing
sudo dnf install google-noto-sans-cjk-ttc-fonts

在红帽的官网找到了语言需要安装的字体,经过学习了官网的语言包文档和本着尝试的态度安装了一下字体:

刚安装好后包括终端所有字体都变“方块”了,这简直了,但是尝试重启电脑后就都恢复了,所以遇到问题不要慌,重启电脑包治百病。

二、共性问题

最终得以解决这个问题,估计是Fedora37、38在镜像的时候忽略了这两个字体的安装导致,因为很多软件也还是在使用的,后来发现网上有同样的问题也出现在Linux Steam中。

三、参考

https://bugzilla.redhat.com/show_bug.cgi?id=2188765

When you input Chinese text using IBUS "Chinese - Intelligent Pinyin" (traditional) into a Java GUI program, it is rendered as squares as if a font is missing. This worked in Fedora 37. Upgraded to 38 this evening and discovered the squares.

Reproducible: Always

Steps to Reproduce:
1. Boot Fedora 38's Cinnamon spin in a VM.
2. Install `java-17-openjdk`
3. Launch any Java program that allows text input. Any hello world JSwing demo will work. JDownloader's settings has some text inputs that also show this.
Actual Results:  
Both in a toy utility and JDownloader the Chinese shows up as squares while you can see the actual Chinese characters in libpinyin's selection.

Expected Results:  
The Chinese shows up in the Java and libpinyin.

The following dnf commands will make it render again and solve the problem.

dnf install google-noto-sans-cjk-fonts.noarch --allowerasing
dnf install google-noto-sans-cjk-ttc-fonts

Both packages must be installed. If only the fonts but not ttc package is installed, the Chinese is rendered in Java but is now squares in the libpinyin input. Libpinyin appears to need the ttc fonts.

It appears something is missing from the new google-noto-sans-cjk-vf-fonts.noarch package that supercedes the above.
滚动至顶部