From: Stephan Kulow Date: Mon, 12 Mar 2007 17:21:35 +0000 (-0700) Subject: Make FcPatternDuplicate copy the binding instead of always using Strong. X-Git-Tag: 2.4.91~40 X-Git-Url: https://git.wh0rd.org/?p=fontconfig.git;a=commitdiff_plain;h=9b74b78fe87f75f7026bfb23ab43ef347e109ca6 Make FcPatternDuplicate copy the binding instead of always using Strong. I noticed that Qt always uses a different font than fc-match advertises. Debugging the issue, I found that a call that looks pretty innocent is changing all weak bindings to strong bindings and as such changes the semantic of the match: FcPatternDuplicate. --- diff --git a/src/fcpat.c b/src/fcpat.c index 052874f..4179694 100644 --- a/src/fcpat.c +++ b/src/fcpat.c @@ -925,10 +925,14 @@ FcPatternDuplicate (const FcPattern *orig) for (i = 0; i < orig->num; i++) { for (l = FcPatternEltValues(e + i); l; l = FcValueListNext(l)) - if (!FcPatternObjectAdd (new, e[i].object, - FcValueCanonicalize(&l->value), - FcTrue)) + { + if (!FcPatternObjectAddWithBinding (new, e[i].object, + FcValueCanonicalize(&l->value), + l->binding, + FcTrue)) goto bail1; + + } } return new;