<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <description>Guess a generic-family for substitution</description>
  <!-- monospace -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>mono</string>
    </test>
    <edit name="family" mode="append_last">
      <string>monospace</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family" compare="contains">
      <string>mono</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>monospace</const>
    </edit>
  </match>
  <!-- sans-serif -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>sans</string>
    </test>
    <test qual="all" name="family" compare="not_contains">
      <string>mono</string>
    </test>
    <edit name="family" mode="append_last">
      <string>sans-serif</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family" compare="contains">
      <string>sans</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>sans-serif</const>
    </edit>
  </match>
  <!-- serif -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>serif</string>
    </test>
    <test qual="all" name="family" compare="not_eq">
      <string>sans-serif</string>
    </test>
    <edit name="family" mode="append_last">
      <string>serif</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family" compare="contains">
      <string>serif</string>
    </test>
    <test qual="all" name="family" compare="not_eq">
      <string>sans-serif</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>serif</const>
    </edit>
  </match>
  <!-- emoji -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>emoji</string>
    </test>
    <edit name="family" mode="append_last">
      <string>emoji</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family" compare="contains">
      <string>emoji</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>emoji</const>
    </edit>
  </match>
  <!-- math -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>math</string>
    </test>
    <edit name="family" mode="append_last">
      <string>math</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family" compare="contains">
      <string>math</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>math</const>
    </edit>
  </match>
  <!-- system-ui -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>system-ui</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>system-ui</const>
    </edit>
  </match>
  <!-- cursive -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>cursive</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>cursive</const>
    </edit>
  </match>
  <!-- fantasy -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>fantasy</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>fantasy</const>
    </edit>
  </match>
  <!-- ui-sans-serif -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>ui-sans-serif</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>ui-sans-serif</const>
    </edit>
  </match>
  <!-- ui-serif -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>ui-serif</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>ui-serif</const>
    </edit>
  </match>
  <!-- ui-monospace -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>ui-monospace</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>ui-monospace</const>
    </edit>
  </match>
  <!-- ui-rounded -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>ui-rounded</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>ui-rounded</const>
    </edit>
  </match>
  <!-- fangsong -->
  <match target="pattern">
    <test name="family" compare="contains">
      <string>fangsong</string>
    </test>
    <test qual="all" name="genericfamily" compare="contains">
      <const xsi:nil="true"/>
    </test>
    <edit name="genericfamily" mode="append">
      <const>fangsong</const>
    </edit>
  </match>
</fontconfig>
