[Fontconfig] rule to exclude certain fonts based on file type and name scheme

Nicolas Mailhot nicolas.mailhot at laposte.net
Thu Sep 5 02:40:14 PDT 2013


Le Mer 4 septembre 2013 21:24, Fabian Greffrath a écrit :
> Am Mittwoch, den 04.09.2013, 12:30 +0900 schrieb Akira TAGOH:
>> Indeed, but uninstalling such fonts may be easier to exclude then.
>
> Unfortunately, that is not that easily possible. the Type 1 variant of
> these fonts in installed alongside the Opentype variant. Since the Font
> Names of both variants are slightly different, both variants show up in
> font selectors. Thus, I need a rule to exclude all of the Type 1
> variants that carry the common Font Family name in their Font Names.

The cleaner way in that case is probably to rename the type1 fonts to the
opentype name, and make the opentype version higher priority than the
opentype one in fontconfig

 <match target="scan">
    <test name="fullname">
      <string>type1 name</string>
    </test>
    <edit name="family">
      <string>opentype name</string>
    </edit>
    <edit name="fullname">
      <string>opentype fullname</string>
    </edit>
    <edit name="fontversion">
      <int>number lower than the opentype version</int>
    </edit>
  </match>

Though it sucks that you have to override the font version to change
same-name font priorities in fontconfig

-- 
Nicolas Mailhot



More information about the Fontconfig mailing list