How should I modify fonts.conf to display different fonts for English and Chinese?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
omonk
Level 1
Level 1
Posts: 25
Joined: Wed Sep 16, 2020 9:35 pm

How should I modify fonts.conf to display different fonts for English and Chinese?

Post by omonk »

As the question, I am a Chinese user, the system version is linuxmint xfce 20.1. I want to use Ubuntu to display English and noto sans cjk sc to display Chinese. I looked at the config from archwiki and tossed it around a bit, but it didn't work. Here is the configuration in

Code: Select all

~/.config/fontconfig/fonts.conf
I don't know how to set it...

Code: Select all

<fontconfig>
  
  
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Ubuntu</family>
      <family>Noto Sans CJK SC</family>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>
  
  
  <alias>
    <family>serif</family>
    <prefer>
      <family>Ubuntu</family>
      <family>Noto Serif CJK SC</family>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>

  <alias>
    <family>monospace</family>
    <prefer>
      <family>JetBrains Mono</family>
      <family>Noto Sans Mono CJK SC</family>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>

  <match target="pattern">
    <test qual="any" name="family">
      <string>Helvetica</string>
    </test>
    <edit name="family" mode="assign" binding="same">
      <string>sans-serif</string>
    </edit>
  </match>

  <match target="pattern">
    <test qual="any" name="family">
      <string>Consolas</string>
    </test>
    <edit name="family" mode="assign" binding="same">
      <string>monospace</string>
    </edit>
  </match>

  <match target="pattern">
    <test qual="any" name="family">
      <string>Courier</string>
    </test>
    <edit name="family" mode="assign" binding="same">
      <string>monospace</string>
    </edit>
  </match>

 <match target="font">
  
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>

  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>

  <edit mode="assign" name="hintstyle">
   <const>hintfull</const>
  </edit>

  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>

  <edit mode="assign" name="lcdfilter">
    <const>lcddefault</const>
  </edit>
 
 </match>
</fontconfig>
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
omonk
Level 1
Level 1
Posts: 25
Joined: Wed Sep 16, 2020 9:35 pm

Re: How should I modify fonts.conf to display different fonts for English and Chinese?

Post by omonk »

:(
Locked

Return to “Software & Applications”