meh / cancer

It's terminal.
GNU General Public License v3.0
129 stars 12 forks source link

Add fallback font options. #15

Closed CamilleScholtz closed 7 years ago

CamilleScholtz commented 7 years ago

Sorry if this is already possible!

meh commented 7 years ago

It is possible, it has to be done through fontconfig tho, which allows for much more control.

This is mine, then I just use monospace 11px as font.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="pattern">
    <test qual="any" name="family">
        <string>monospace</string>
    </test>

    <edit mode="assign" name="pixelsize">
        <int>11</int>
    </edit>

    <edit name="family" mode="prepend_first">
      <string>Kochi Gothic</string>
    </edit>

    <edit name="family" mode="prepend_first">
      <string>Baekmuk Gulim</string>
    </edit>

    <edit name="family" mode="prepend_first">
      <string>Noto Sans</string>
    </edit>

    <edit name="family" mode="prepend_first">
      <string>GohuFont</string>
    </edit>

    <edit name="family" mode="prepend_first">
      <string>EmojiOne Color</string>
    </edit>
  </match>

  <match target="pattern">
    <test name="family">
      <string>Kochi Gothic</string>
    </test>

    <edit name="antialias" mode="assign">
      <bool>false</bool>
    </edit>
  </match>
</fontconfig>