Make FC_FULLNAME include all fullname entries, elide nothing. [bug 12827]
The old policy of eliding fullname entries which matched FC_FAMILY or FC_FAMILY + FC_STYLE meant that applications could not know what the font foundry set as the fullname of the font. Hiding information is not helpful.
This commit is contained in:
parent
144ca87831
commit
f7da903d37
|
@ -1330,70 +1330,6 @@ FcFreeTypeQueryFace (const FT_Face face,
|
||||||
++nfamily;
|
++nfamily;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Walk through FC_FULLNAME entries eliding those in FC_FAMILY
|
|
||||||
* or which are simply a FC_FAMILY and FC_STYLE glued together
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
int fn, fa;
|
|
||||||
FcChar8 *full;
|
|
||||||
FcChar8 *fam;
|
|
||||||
FcChar8 *style;
|
|
||||||
|
|
||||||
for (fn = 0; FcPatternGetString (pat, FC_FULLNAME, fn, &full) == FcResultMatch; fn++)
|
|
||||||
{
|
|
||||||
FcBool remove = FcFalse;
|
|
||||||
/*
|
|
||||||
* Check each family
|
|
||||||
*/
|
|
||||||
for (fa = 0; !remove &&
|
|
||||||
FcPatternGetString (pat, FC_FAMILY,
|
|
||||||
fa, &fam) == FcResultMatch;
|
|
||||||
fa++)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* for exact match
|
|
||||||
*/
|
|
||||||
if (!FcStrCmpIgnoreBlanksAndCase (full, fam))
|
|
||||||
{
|
|
||||||
remove = FcTrue;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* If the family is in the full name, check the
|
|
||||||
* combination of this family with every style
|
|
||||||
*/
|
|
||||||
if (!FcStrContainsIgnoreBlanksAndCase (full, fam))
|
|
||||||
continue;
|
|
||||||
for (st = 0; !remove &&
|
|
||||||
FcPatternGetString (pat, FC_STYLE,
|
|
||||||
st, &style) == FcResultMatch;
|
|
||||||
st++)
|
|
||||||
{
|
|
||||||
FcChar8 *both = FcStrPlus (fam, style);
|
|
||||||
|
|
||||||
if (both)
|
|
||||||
{
|
|
||||||
if (FcStrCmpIgnoreBlanksAndCase (full, both) == 0)
|
|
||||||
remove = FcTrue;
|
|
||||||
free (both);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (remove)
|
|
||||||
{
|
|
||||||
FcPatternRemove (pat, FC_FULLNAME, fn);
|
|
||||||
FcPatternRemove (pat, FC_FULLNAMELANG, fn);
|
|
||||||
fn--;
|
|
||||||
nfullname--;
|
|
||||||
nfullname_lang--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (FcDebug () & FC_DBG_SCANV)
|
|
||||||
for (fn = 0; FcPatternGetString (pat, FC_FULLNAME, fn, &full) == FcResultMatch; fn++)
|
|
||||||
printf ("Saving unique fullname %s\n", full);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!FcPatternAddString (pat, FC_FILE, file))
|
if (!FcPatternAddString (pat, FC_FILE, file))
|
||||||
goto bail1;
|
goto bail1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue