Fix CJK font order on Linux (Ubuntu)
A short post for something I’ll probably need to remember in the future. In Unicode, Chinese simplified, traditional, and Japanese style characters all use the same glyphs. Font rendering is used to turn the glyph into a simplified, traditional, or Japanese style character. Today I found my Ubuntu system was using Japanese style characters while I wanted it to use Chinese simplified (since I’m learning that). Sadly changing this wasn’t as simple as a toggle in a menu, so here I write down what I did to fix it.
For an illustration of the problem, see Wikipedia: Examples of language-dependent glyphs.
Ubuntu’s font configuration is stored in /etc/fonts/conf.d
. In this directory there’s a lot of files. Eventually I found that 64-language-selector-prefer.conf
contained the configuration needed to change the default rendering of CJK (Chinese, Japanese, Korean) characters. In this file, you can simply change the order:
The default ordering seems to be Japanese first.
To refresh the font config cache, you can run: FC_DEBUG=1024 fc-cache
(FC_DEBUG will make it so you can see which files are being read)
This should fix the font rendering! Happy hacking.
Note that Firefox ignores this configuration and instead uses its own font configuration under about:config key font.cjk_pref_fallback_order.