[Fontconfig] Use english font face names instead of system locale
behdad at behdad.org
Wed Apr 6 08:00:50 PDT 2011
This is re Bug 27765 - FcMatch() returns style in wrong language
On 04/05/11 04:30, Ulrich von Zadow wrote:
>>>>> Actually right now fontconfig is buggy and returns the first style name, no
>>>>> matter what language that is. :( I plan to fix it, but don't have time to
>>>>> spend on fontconfig immediately. It's somewhere there in fontconfig bugzilla.
> I'd be glad for any pointers...
This is how I think this should be fixed:
Add a new element FC_NAME_LANG="namelang".
In FcFreeTypeQuery, perhaps set FC_NAME_LANG to the intersection of
FC_FAMILY_LANG and FC_STYLE_LANG. Or maybe don't. Not going to use this
In FcConfigDefault, if FC_NAME_LANG is empty, fill it in from default locale
language. Then if FC_FAMILY_LANG is empty, copy it from FC_NAME_LANG. Same
for FC_STYLE_LANG and FC_FULLNAME_LANG. This way, FC_NAME_LANG is how the
user will request names in a particular language.
In FcFontRenderPrepare, when deciding what FC_FAMILY and FC_STYLE to choose,
choose the first one that has a _LANG equivalent present in the query
pattern's respective _LANG element.
That should do it.
More information about the Fontconfig