[Fontconfig] Matching font names

Jeremy Sanders jeremy at jeremysanders.net
Mon May 12 07:21:17 PDT 2008


Hi - I'm trying to match font names to switch off antialiasing for specific
fonts in a font config file. I can't get it to work properly. Here is an
example:

  <!--- turn off antialiasing for these fonts -->
  <match target="pattern">
    <test qual="any" name="family">
      <string>Courier New</string>
    </test>
        <edit mode="assign" name="antialias" >
      <bool>false</bool>
    </edit>
  </match>
  <match target="pattern">
     <test qual="any" name="family">
      <string>Times New Roman</string>
    </test>
    <edit mode="assign" name="antialias" >
      <bool>false</bool>
    </edit>
  </match>
  <match target="pattern">
    <test qual="any" name="family">
      <string>Arial</string>
    </test>
    <edit mode="assign" name="antialias" >
      <bool>false</bool>
    </edit>
  </match> 

This is to disable antialiasing for Courier New, Times New Roman and Arial.
This appears to work partly, but also switches off antialiasing for other
fonts, for instance "DejaVu LGC Sans Mono" but not "DejaVu Sans Mono".

Any idea what I have done wrong?

Could I do something like this instead?
  <match target="pattern">
    <test qual="any" name="family">
      <string>Arial</string>
      <string>Times New Roman</string>
      <string>Courier New</string>
    </test>
    <edit mode="assign" name="antialias" >
      <bool>false</bool>
    </edit>
  </match> 


I have to say that the user docs are very hard to follow. I think they need
to be simplified for the user. I still do not understand what "When used in
a <match target="font"> element, the target= attribute in the <test>
element selects between matching the original pattern or the font." It is
pretty much gobbledygook.

Thanks

Jeremy




More information about the Fontconfig mailing list