[Fontconfig] any possible trouble by adding lang to the pattern by default

Raimund Steger rs at mytum.de
Wed May 30 06:00:59 PDT 2012

Jjgod Jiang wrote:
> Hi,
> On Wed, May 30, 2012 at 4:47 AM, Akira TAGOH<akira at tagoh.org>  wrote:
>> On Wed, May 30, 2012 at 7:02 AM, Raimund Steger<rs at mytum.de>  wrote:
>>> LANG (as opposed to FC_LANG) *is* already used to provide a default value
>>> dynamically, provided programs use FcDefaultSubstitute which I think they
>>> all do.
>>> (BTW- Akira- is there a special reason why applying the new string set
>>> needed to be done in FcConfigSubstituteWithPat in addition to
>>> FcDefaultSubstitute?)
>> Well, honestly I don't still even have the reasonable answer for that
>> though, FcDefaultSubstitute() seems supposed to call after
>> FcConfigSubstitute().
>> https://bugs.freedesktop.org/show_bug.cgi?id=35482#c2

Ah OK. That makes things clearer.

> [...]
> then this will happen in FcConfigSubstitute() which is (normally)
> earlier than FcDefaultSubstitute(), then I don't get the lang set
> by FcDefaultSubstitute().

OK I think I get it now. You want the lang from the environment already 
at the time of config substitution, so that you can still react on it in 
the course of your normal ~/.fonts.conf, and preferably inferred from 
your normal locale settings without having to set any program-specific 
separate configuration files etc.?

Well in that case Akira's fix seems quite useful.

I think that changing the recommended order of the API calls otherwise 
isn't a good idea, too, because the user should be the first instance 
that has the opportunity to specify defaults for missing properties, 
except maybe on such highly content-specific/dynamic properties as 'lang'.


More information about the Fontconfig mailing list