[Fontconfig] Making family names returned by FcFreeTypeQueryFace locale aware?

suzuki toshiya mpsuzuki at hiroshima-u.ac.jp
Tue Dec 28 03:00:12 PST 2010


Although I'm not a fontconfig maintainer, I'm interested in this issue,
but no time to review in detail, sorry.

Regards,
mpsuzuki

Jjgod Jiang wrote:
> On Fri, Dec 17, 2010 at 1:06 PM, Jjgod Jiang <gzjjgod at gmail.com> wrote:
>> We hit a locale sensitivity issue of font family name matching
>> in Qt. We use fontconfig like this:
>>
>> * For system fonts, we query the list of fonts with FcFontList()
>>  and store the first family name of each result in a list,
>>  these family names are always locale aware because the results
>>  returned by FcFontList() are always locale aware.
>>
>> * For application fonts, we construct a FTFace from the data and
>>  use FcFreeTypeQueryFace to get a FcPattern from it, then get
>>  the first family name in the pattern returned, store it in a
>>  list. However, the family names returned in this pattern are
>>  *NOT* locale aware.
>>
>> The problem of above methods is the family names from the
>> application font list cannot be used to query a font in the
>> first family name list.
>>
>> For instance, if I have the font "SimSun.ttc", my locale is
>> zh_CN.UTF-8, then the first list will have "宋体" while the
>> application font list will have "SimSun".
>>
>> Possible solutions will be make the family names in the pattern
>> returned by FcFreeTypeQueryFace locale aware, or at least let
>> us to get id of family name in locale aware manner, currently
>> all the locale related functions in fontconfig are private,
>> thus we cannot reproduce the entire locale matching process
>> without duplicate fontconfig code in Qt.
>>
>> Any suggestions?
> 
> Anyone have any opinion about this question?
> 
> If there is no objection, I can provide a patch for it, but I
> just need to make sure the maintainer is willing to integrate
> such a change.
> 
> - Jiang
> _______________________________________________
> Fontconfig mailing list
> Fontconfig at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/fontconfig



More information about the Fontconfig mailing list