summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2013-03-01 22:21:25 +0900
committerAkira TAGOH <akira@tagoh.org>2013-03-01 22:21:25 +0900
commit612ee2a5c91b8929b2cc5abce4af84d8d7e66bd0 (patch)
treeccd7a48a950baaa13661f8204e9aa56fa56893b4
parentea4ebd59377d3dff3616bd20381f308a92781ae6 (diff)
Fix broken sort order with FcFontSort()
-rw-r--r--src/fcmatch.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fcmatch.c b/src/fcmatch.c
index 09c1b6a..23f985a 100644
--- a/src/fcmatch.c
+++ b/src/fcmatch.c
@@ -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;
}
}