qual="all" can actually already be used to test that a value is not set because it always returns true when there are no values to test. i.e. All zero values match.
For the rgba case, overriding a value of "unknown" seems quite reasonable.
The match will apply when rgba is set to "unknown" or when rgba is not set.
For some other properties there is no unknown value, and so using qual="all" gets more obscure because we have to compare with a value that will never match an appropriately set value. e.g.
I found that making these "set when not already set" rules work appropriately with Qt3 required an additional hack. Qt3 was calling FcFontMatch (and thus FcFontRenderPrepare) before XftFontMatch (which calls FcFontMatch again after
XftDefaultSubstitute). Xft screen options had not been applied in the
first FcFontRenderPrepare (before XftFontMatch), and so the rules were matching and setting values that would take precedence over Xft screen options. This situation was detectable through missing pixelsize as FcDefaultSubstitute had not been called before the first FcFontRenderPrepare. I haven't looked at Qt4.
This test matches only when pixelsize is set (-1.0 is considered an inappropriate value).
qual="all" can actually already be used to test that a value is not set because it always returns true when there are no values to test. i.e. All zero values match.
For the rgba case, overriding a value of "unknown" seems quite reasonable.
<match target="font"> ><const> unknown< /const> </test> ><const> none</const> </edit>
<test name="rgba" qual="all"
<edit name="rgba" mode="assign"
</match>
The match will apply when rgba is set to "unknown" or when rgba is not set.
For some other properties there is no unknown value, and so using qual="all" gets more obscure because we have to compare with a value that will never match an appropriately set value. e.g.
<match target="font"> ><int>- 1</int> </test> ><const> hintmedium< /const> </edit>
<test name="hintstyle" qual="all"
<edit name="hintstyle" mode="assign"
</match>
I found that making these "set when not already set" rules work appropriately with Qt3 required an additional hack. Qt3 was calling FcFontMatch (and thus FcFontRenderPre pare) before XftFontMatch (which calls FcFontMatch again after itute). Xft screen options had not been applied in the pare. I haven't looked at Qt4.
XftDefaultSubst
first FcFontRenderPrepare (before XftFontMatch), and so the rules were matching and setting values that would take precedence over Xft screen options. This situation was detectable through missing pixelsize as FcDefaultSubstitute had not been called before the first FcFontRenderPre
This test matches only when pixelsize is set (-1.0 is considered an inappropriate value).
<test name="pixelsize" target="pattern" compare="not_eq"> -1.0</double>
<double>
</test>