<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Warn if config is wrong"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=82582">82582</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>fontconfig-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Warn if config is wrong
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>freedesktop@behdad.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>freedesktop@behdad.org
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>library
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>fontconfig
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I know we don't do full xml validation against the DTD, but at least, we should
be able to catch many nonsensical configs, for example, someone trying this:

<match target="font">
    <or>
      <test name="family" compare="contains">
        <string>MYingHeiB5HK</string>
      </test>
      <test name="family" compare="contains">
        <string>MYingHeiGB18030</string>
      </test>
      <test name="family" compare="contains">
        <string>MSung GB18030</string>
      </test>
      <test name="family" compare="contains">
        <string>MSung B5HK</string>
      </test>
    </or>
    <!-- Turn on light auto-hint -->
    <!-- Turn off sub-pixel anti-aliasing -->
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="autohint" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintslight</const></edit>
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="rgba" mode="assign"><const>none</const></edit>
 </match>

The problem is, <or> doesn't go in <match>, and <test> doesn't go in <or>.  It
just edits the pattern unconditionally! 

I *think* the correct way to write it is:

 <match target="font"> 
    <test name="family" compare="contains"> 
      <or> 
        <string>MYingHeiB5HK</string> 
        <string>MYingHeiGB18030</string> 
        <string>MSung GB18030</string> 
        <string>MSung B5HK</string> 
      </or> 
    </test> 

I hear in the past (with 2.7.x), this used to work:

<match target="font">
   <test name="family" compare="contains">
        <string>MYingHeiB5HK</string>
        <string>MYingHeiGB18030</string>
        <string>MSung GB18030</string>
        <string>MSung B5HK</string>
    </test>
    <!-- Turn on light auto-hint -->
    <!-- Turn off sub-pixel anti-aliasing -->
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="autohint" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintslight</const></edit>
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="rgba" mode="assign"><const>none</const></edit>
 </match>

but with 2.11.x started warning about multiple strings in <test>...</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>