Fix broken sort order with FcFontSort()

which was introduced by 4eab908c86
This commit is contained in:
Akira TAGOH 2013-03-01 22:21:25 +09:00
parent ea4ebd5937
commit 612ee2a5c9
1 changed files with 7 additions and 0 deletions

View File

@ -911,6 +911,13 @@ FcFontSetSort (FcConfig *config FC_UNUSED,
}
patternLangSat[i] = FcTrue;
satisfies = FcTrue;
/* adjust score to ensure it's not more than 10000.0
* which would means the lang didn't satisfy the requirements
*/
if (nodeps[f]->score[PRI_LANG_STRONG] > 10000.0)
nodeps[f]->score[PRI_LANG_STRONG] = 10000.0;
if (nodeps[f]->score[PRI_LANG_WEAK] > 10000.0)
nodeps[f]->score[PRI_LANG_WEAK] = 10000.0;
break;
}
}