[Fontconfig] pattern matching and embolden

Michael Peters mpeters at mac.com
Sun Oct 16 06:07:42 EST 2005


This is related to my earlier post.
I'm using fontconfig-2.3.2-1 in Fedora Rawhide

I have a font that uses a unique family name for each style.
The font is LucidaMonoEFOP (Elsner + Flake)

I have had some limited success getting it to use the bold family when bold attribute of Roman is requested with the following in my ~/.fonts.conf file:

<match target="pattern">
  <!-- check to see if the font is LucidaMonoEFOP -->
  <test qual="any" name="family">
    <string>LucidaMonoEFOP-Roman</string>
  </test>
  <!-- check to see if the font requests bold -->
  <test target="pattern" name="weight" compare="more_eq">
    <int>200</int>
  </test>
  <!-- tell it what font to use -->
  <edit name="family" mode="assign">
    <string>LucidaMonoEFOP-Bold</string>
  </edit>
  <!-- BELOW don't seem to work -->
  <!-- turn off fake embolding - This does not work -->
  <edit name="weight" mode="assign">
    <int>200</int>
  </edit>
  <!-- turn off fake embolding - This does not work -->
  <edit name="embolden" mode="assign">
    <bool>false</bool>
  </edit>
</match>

To test it I am using the bluefish editor, and setting LucidaMonoEFOP-Roman as the default font.
Without any modification to any conf files, it will use embolden where the syntax highlighting wants embolden.

With the above match in my local ~/.fonts.conf file - it will use LucidaMonoEFOP-Bold but will embolden the bold resulting in double bold. I tried disabling the artificial embolden but it doesn't seem to let me, the only way to get rid of the artificial embolden seems to be to disable it globally in the fonts.conf file.

I also tested it gnumeric - it will use the real bold font when I select LucidaMonoEFOP-Roman and click the bold tag, but it will also false embolden it if I haven't disabled the false embolden globally.

Any pointers on how to turn it off on a per font basis?

-=-
Furthermore - while it clear works in bluefish - the match doesn't seem to work in Mozilla - fake embolding doesn't seem to work in Mozilla either (I've got a small test page where I specify the font with font face) - and I can't get xfd to do the substitution either (via xfd -fa "LucidaMonoEFOP\-Roman:style=Bold )

I've tried with both pango enabled and pango disabled. I'm guessing that's a mozilla issue - and not a fontconfig issue?



More information about the Fontconfig mailing list