How to change the default font of Linux

You’ll need to edit/create the file ~/.fonts.conf.

  • The file does not exist by default. However, if you’ve used things like Font Manager, then there might be a placeholder file at ~/.fonts.conf telling you to use ~/.config/font-manager/local.conf instead, in which case you should create the latter.
  • You should first open ~/.fonts.conf to check.
  • To check if the file exists, a simple way would be to open the file manager, go to “Home”, check “View->Show Hidden Files” and see if you can find .fonts.conf.

Once you’ve created the file, put the following code in it:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>Droid Sans</family>
            <family>WenQuanYi Micro Hei Mono</family>
        </prefer>
    </alias>
</fontconfig>

What it does is create a font resolution fallback list. When a program is requesting a sans-serif font (most GUI fonts are sans-serif by default), the system would try to use the first font (Droid Sans) for a character. If the font does not support that character, the second (UKai) will be used. I’m not sure if specifying Droid Sans as the first preference has any significance, but you might as well keep it, just to be safe.

Note also that you’ll need to logout of your account and login again to see the effect.

 

From

https://askubuntu.com/questions/73721/how-do-i-change-the-default-chinese-font

No Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

粤ICP备15062915号-1