[Fontconfig] Changing the default pattern weight via config?

Thomas Sibley www+fontconfig at zulutango.org
Tue Sep 13 05:21:50 UTC 2016


On Tue, Sep 13, 2016 at 11:32:38AM +0900, Akira TAGOH wrote:
> Well, this will works if the best matched fonts against the query pattern
> has the medium weight because the evaluation of the score for the weight
> isn't that higher priority in fontconfig. otherwise you may need to write
> more, particularly for family name maybe.
> 
> <match>
>   <edit name="weight" mode="append" binding="strong">
>     <const>medium</const>
>   </edit>
> </match>

Ah, this does help!  The key piece I was missing was the idea of
appending to the list of weights in the pattern so that any explicitly
specified weight still came first.

I want to go from the default weight of medium on an ancient fontconfig
to a local user default of regular (i.e. matching newer fontconfig), so
I'm specifying regular rather than medium in my config:

    <match>
      <edit name="weight" mode="append" binding="strong">
        <const>regular</const>
      </edit>
    </match>

Thanks!


More information about the Fontconfig mailing list