跳轉到

Avoid Ugly Fallbacks

Add the patch to fontconfig to avoid ugly fallbacks.

Make use of my Ubuntu and Noto Sans. And JetBrains Mono NL is responsible for code blocks.

Thanks to cubercsl and coelacanthus.

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
 <match>
  <test name="family" compare="contains">
   <string>ui-sans-serif</string>
  </test>
  <edit name="family">
   <string>sans-serif</string>
  </edit>
 </match>
 <match>
  <test name="family" compare="contains">
   <string>ui-serif</string>
  </test>
  <edit name="family">
   <string>serif</string>
  </edit>
 </match>
 <match>
  <test name="family" compare="contains">
   <string>ui-monospace</string>
  </test>
  <edit name="family">
   <string>monospace</string>
  </edit>
 </match>


  <!-- 无衬线字体 -->
  <match target="pattern">
    <test name="family">
      <string>-apple-system</string>
    </test>
    <edit name="family" binding="same">
      <string>Ubuntu</string>
      <string>Noto Sans</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family">
      <string>Arial</string>
    </test>
    <edit name="family" binding="same">
      <string>Ubuntu</string>
      <string>Noto Sans</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family">
      <string>Helvetica</string>
    </test>
    <edit name="family" binding="same">
      <string>Ubuntu</string>
      <string>Noto Sans</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family">
      <string>Segoe UI</string>
    </test>
    <edit name="family" binding="same">
      <string>Ubuntu</string>
      <string>Noto Sans</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family">
      <string>Liberation</string>
    </test>
    <edit name="family" binding="same">
      <string>Ubuntu</string>
      <string>Noto Sans</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family" compare="contains">
      <string>文泉驿</string>
    </test>
    <test name="family" compare="contains">
      <string>WenQuanYi</string>
    </test>
    <edit name="family" binding="same">
      <string>Noto Sans</string>
      <string>Noto Sans CJK SC</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family" compare="contains">
      <string>Microsoft YaHei</string>
    </test>
    <edit name="family" binding="same">
      <string>Noto Sans</string>
      <string>Noto Sans CJK SC</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family">
      <string>微软雅黑</string>
    </test>
    <edit name="family" binding="same">
      <string>Noto Sans</string>
      <string>Noto Sans CJK SC</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family">
      <string>SimHei</string>
    </test>
    <edit name="family" binding="same">
      <string>Noto Sans</string>
      <string>Noto Sans CJK SC</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family">
      <string>黑体</string>
    </test>
    <edit name="family" binding="same">
      <string>Noto Sans CJK SC</string>
    </edit>
  </match>
  <!-- 等宽字体 -->
  <match target="pattern">
    <test name="family">
      <string>Consolas</string>
    </test>
    <edit name="family" binding="same">
      <string>monospace</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family">
      <string>Liberation Mono</string>
    </test>
    <edit name="family" binding="same">
      <string>monospace</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family" compare="contains">
      <string>courier</string>
    </test>
    <test name="family" compare="contains">
      <string>Courier</string>
    </test>
    <edit name="family" binding="same">
      <string>monospace</string>
    </edit>
  </match>
 <!-- Default serif font -->
  <alias binding="strong">
    <family>serif</family>
    <prefer>
      <family>Ubuntu</family>       
      <family>Noto Serif</family>
      <family>emoji</family>
    </prefer>
  </alias>

  <!-- Default sans-serif font -->
  <alias binding="strong">
    <family>sans-serif</family>
    <prefer>
      <family>Ubuntu</family>       
      <family>Noto Sans</family>
      <family>emoji</family>
    </prefer>
  </alias>

  <!-- Default monospace font -->
  <alias binding="strong">
    <family>monospace</family>
    <prefer>
      <family>JetBrains Mono NL</family>
      <family>emoji</family>
    </prefer>
  </alias>

  <!-- Default system-ui font -->
  <alias binding="strong">
    <family>system-ui</family>
    <prefer>
      <family>Ubuntu</family>
      <family>Noto Sans</family>
      <family>emoji</family>
    </prefer>
  </alias> 

最後更新: 2022-05-19 00:27:19
建立日期: 2022-05-14 23:38:40
Back to top