[Fontconfig] Changing the default pattern weight via config?

Akira TAGOH akira at tagoh.org
Tue Sep 13 02:32:38 UTC 2016


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>

Without the above:
$ fc-match -f "%{family} - weight: %{weight}\n" "Source Han Sans CN"
Source Han Sans CN,思源黑体 CN,Source Han Sans CN Regular,思源黑体 CN Regular -
weight: 80

With the above:
$ fc-match -f "%{family} - weight: %{weight}\n" "Source Han Sans CN"
Source Han Sans CN,思源黑体 CN,Source Han Sans CN Medium,思源黑体 CN Medium -
weight: 100

HTH,

On Tue, Sep 13, 2016 at 10:06 AM, Thomas Sibley <
www+fontconfig at zulutango.org> wrote:

> Hi,
>
> With version 2.11.1, the default weight for patterns missing a weight
> changed from medium to regular.¹  Is there any way to replicate that
> change in earlier versions using local configuration files?
>
> I've tried a number of ways with <match> and friends, but I am unable to
> force a pattern without a weight to yield weight=regular while still
> allowing a pattern with a weight to pass through the <match> unchanged.
> The crux of the problem is that I can't determine a way to specifically
> match a property with no value (which I believe is what I need to do to
> change the pattern before it gets filled in with defaults).
>
> Any pointers would be appreciated.  If it's known to be impossible,
> that's also useful to know.  :-)
>
> Cheers,
> Thomas
>
> ¹ Some context here:
>   https://lists.freedesktop.org/archives/fontconfig/2013-
> October/004978.html
> _______________________________________________
> Fontconfig mailing list
> Fontconfig at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/fontconfig
>



-- 
Akira TAGOH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig/attachments/20160913/56e1022a/attachment.html>


More information about the Fontconfig mailing list