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

Jjgod Jiang gzjjgod at gmail.com
Tue Dec 28 02:56:38 PST 2010


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


More information about the Fontconfig mailing list