diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2017-09-16 13:45:02 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2017-09-20 13:21:13 -0700 |
commit | 2544bc5343d84a1f7e793cdae3569150b0ec3d05 (patch) | |
tree | 50a56a3f589c0acf58dcee5b426359a887bcce9e /src/fcmatch.c | |
parent | c2fcde498a8b7dec012a8da8ffa78f72a65ac50d (diff) | |
download | fontconfig-2544bc5343d84a1f7e793cdae3569150b0ec3d05.tar.gz |
Add FcDontCare value to FcBool
This can be used for FC_VARIABLE=FcDontCare for example, to opt into getting
variable fonts for clients that support using them.
Diffstat (limited to 'src/fcmatch.c')
-rw-r--r-- | src/fcmatch.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fcmatch.c b/src/fcmatch.c index f217539..d5eaea7 100644 --- a/src/fcmatch.c +++ b/src/fcmatch.c @@ -154,8 +154,12 @@ FcCompareBool (const FcValue *v1, const FcValue *v2, FcValue *bestValue) if (v2->type != FcTypeBool || v1->type != FcTypeBool) return -1.0; - *bestValue = FcValueCanonicalize (v2); - return (double) v2->u.b != v1->u.b; + if (v2->u.b != FcDontCare) + *bestValue = FcValueCanonicalize (v2); + else + *bestValue = FcValueCanonicalize (v1); + + return (double) ((v2->u.b ^ v1->u.b) == 1); } static double |