Need help on chinese font configuration

Garuda use SimSun for chinese font, but I prefer Source Sans Pro CN. I've check Arch Wiki, but nothing help me.

sudo pacman -Syu adobe-source-sans-pro-fonts
1 Like

I did install all the fonts, but the apps isn't using Source Sans Pro CN
They use SimSun.

You can easily change default font in KDE settings, if you are using KDE. Also there are certain ways to change default fonts depending upon your DE.

Also, if certain applications still use different font, you have to look in their settings to change their default font.

And finally, you can report here if the problem still persists.

3 Likes

I did can change fonts in kde settings (I use KDE), but I want english use Source Sans Pro, chinese use Source Sans Han CN.

In that case, you must manually edit font configuration.

https://wiki.archlinux.org/index.php/font_configuration

3 Likes

Tried. Not working after reboot.

Read. Sorry.

NOTE: This type of communication doesn't help anyone understand

Explain what have you tried, how was it in current session.
The less you provide, the less you get a solution.
Unless you don't want a solution... not rare case... :upside_down_face:

3 Likes

I am also interested in this topic, but the term "Sans Pro CN" is not to be found on the Internet. Do you mean "Han-Sans-CN"?

Is not correct?

1 Like

Just pull asian-fonts, should be enough :face_with_monocle:

1 Like

That's not wrong, but there are no Chinese language packs among them. :neutral_face:

1 Like

So "sans han cn" after all.

You will find some interesting entries under the search term "sans han cn arch linux".

And here is another find: The Chinese language Garuda Linux on a 2013 15" MBP. Refresh an old Macbook Pro into a… | by Jeremy Cheng | CodeX | Jan, 2021 | Medium

I take the template provide by Arch Wiki, and then modify it to display the fonts I want. But I didn't see any changes after I rename the file ".fonts.conf" and put it in my home directory, and then reboot. So I deleted it.

Yeah, this is the font name. I don't remember this font's name, so I type something that is similar. Sorry for that :cry:

Still not clear enough. Sory.
Archwiki article includes several guides.
Post the path and name of the file, and the contents.
What exactly do you want to achieve?
If I take what you wrote literally, it seems complicated.
We all talk a different English dialect.
Have you tried any of the other suggestions from above answers?

Path: ~/.fonts.conf
Content:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
  <its:translateRule selector="/fontconfig/*[not(self::description)]" translate="no"/>
 </its:rules>
 <description>Android Font Config</description>
 <!-- Font directory list -->
 <dir>/usr/share/fonts</dir>
 <dir>/usr/local/share/fonts</dir>
 <dir prefix="xdg">fonts</dir>
 <!-- the following element will be removed in the future -->
 <dir>~/.fonts</dir>
 <!-- 关闭内嵌点阵字体 -->
 <match target="font">
  <edit name="embeddedbitmap" mode="assign">
   <bool>false</bool>
  </edit>
 </match>
 <!-- 英文默认字体使用 Roboto 和 Noto Serif ,终端使用 DejaVu Sans Mono. -->
 <match>
  <test name="family" qual="any">
   <string>sans</string>
  </test>
  <edit name="family" mode="prepend" binding="strong">
   <string>Source Sans Pro</string>
  </edit>
 </match>
 <match target="pattern">
  <test name="family" qual="any">
   <string>sans</string>
  </test>
  <edit name="family" mode="prepend" binding="strong">
   <string>Source Sans Pro</string>
  </edit>
 </match>
 <match target="pattern">
  <!-- 中文默认字体使用思源黑体和思源宋体,不使用 Noto Sans CJK SC 是因为这个字体会在特定情况下显示片假字. -->
  <match>
   <test name="lang" compare="contains">
    <string>zh</string>
   </test>
   <test name="family">
    <string>sans</string>
   </test>
   <edit name="family" mode="prepend">
    <string>Source Han Sans CN</string>
   </edit>
  </match>
  <!-- Windows & Linux Chinese fonts. -->
  <!-- 把所有常见的中文字体映射到思源黑体和思源宋体,这样当这些字体未安装时会使用思源黑体和思源宋体.
解决特定程序指定使用某字体,并且在字体不存在情况下不会使用fallback字体导致中文显示不正常的情况. -->
  <match target="pattern">
   <test name="family" qual="any">
    <string>WenQuanYi Zen Hei</string>
   </test>
   <edit name="family" mode="assign" binding="same">
    <string>Source Han Sans CN</string>
   </edit>
  </match>
  <match target="pattern">
   <test name="family" qual="any">
    <string>WenQuanYi Micro Hei</string>
   </test>
   <edit name="family" mode="assign" binding="same">
    <string>Source Han Sans CN</string>
   </edit>
  </match>
  <match target="pattern">
   <test name="family" qual="any">
    <string>WenQuanYi Micro Hei Light</string>
   </test>
   <edit name="family" mode="assign" binding="same">
    <string>Source Han Sans CN</string>
   </edit>
  </match>
  <match target="pattern">
   <test name="family" qual="any">
    <string>Microsoft YaHei</string>
   </test>
   <edit name="family" mode="assign" binding="same">
    <string>Source Han Sans CN</string>
   </edit>
  </match>
  <match target="pattern">
   <test name="family" qual="any">
    <string>SimHei</string>
   </test>
   <edit name="family" mode="assign" binding="same">
    <string>Source Han Sans CN</string>
   </edit>
  </match>
  <match target="pattern">
   <test name="family" qual="any">
    <string>SimSun</string>
   </test>
   <edit name="family" mode="assign" binding="same">
    <string>Source Han Serif CN</string>
   </edit>
  </match>
  <match target="pattern">
   <test name="family" qual="any">
    <string>SimSun-18030</string>
   </test>
   <edit name="family" mode="assign" binding="same">
    <string>Source Han Serif CN</string>
   </edit>
  </match>
  <!-- Load local system customization file -->
  <include ignore_missing="yes">conf.d</include>
  <!-- Font cache directory list -->
  <cachedir>/var/cache/fontconfig</cachedir>
  <cachedir prefix="xdg">fontconfig</cachedir>
  <!-- the following element will be removed in the future -->
  <cachedir>~/.fontconfig</cachedir>
  <config>
   <!-- Rescan configuration every 30 seconds when FcFontSetList is called -->
   <rescan>
    <int>30</int>
   </rescan>
  </config>
 </match>
 <match target="font">
  <edit name="hinting" mode="assign">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit name="hintstyle" mode="assign">
   <const>hintslight</const>
  </edit>
 </match>
</fontconfig>

What I want to achieve: The system font is Source Sans Pro 10px, chinese font is Source Han Sans CN 10px.

I tried to make this as clear as I can, but if there is anywhere you don't clear, please tell me.

I cannot go too far on this, but it seems there is one mistake in xml.
The selected part <match> does not close. It should be deleted.

I hope it does what you want.

2 Likes

No it didn't work... the fonts still doesn't change...

Archwiki suggests this file is saved at

~/.config/fontconfig/fonts.conf
or
/etc/fonts/local.conf

Also, this is a user level config, so adding system settings may break it.
Remove what is not user level, following archwiki example.

3 Likes