Skip to content

Instantly share code, notes, and snippets.

@yawnoc
Last active June 21, 2020 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yawnoc/755a87d92ec2e217d78ab8992bdaa17b to your computer and use it in GitHub Desktop.
Save yawnoc/755a87d92ec2e217d78ab8992bdaa17b to your computer and use it in GitHub Desktop.
Linux: configure preferred Chinese fonts
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
~/.config/fontconfig/fonts.conf
The easiest way to set preferred Chinese fonts in Linux is through <prefer>.
There is no need to worry about lang (locale) matching etc.
For each family (serif, sans-serif, monospace) simply use <prefer>,
and include your corresponding default English font family first
(so that English does not get rendered in your preferred Chinese font)
and then put the preferred Chinese font second.
When the system encounters a Chinese character
(for which the default English font has no glyph),
it will immediately fall back onto the preferred Chinese font as desired.
-->
<fontconfig>
<!-- Serif (Note: Noto Sans CJK TC is actually sans) -->
<alias>
<family>serif</family>
<prefer>
<family>DejaVu Serif</family>
<family>Noto Sans CJK TC</family>
</prefer>
</alias>
<!-- Sans-serif -->
<alias>
<family>sans-serif</family>
<prefer>
<family>DejaVu Sans</family>
<family>Noto Sans CJK TC</family>
</prefer>
</alias>
<!-- Monospace -->
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
<family>Noto Sans CJK TC</family>
</prefer>
</alias>
</fontconfig>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment