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">
  <test name="rgba" qual="all"><const>unknown</const></test>
  <edit name="rgba" mode="assign"><const>none</const></edit>
</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">
  <test name="hintstyle" qual="all"><int>-1</int></test>
  <edit name="hintstyle" mode="assign"><const>hintmedium</const></edit>
</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 
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).

  <test name="pixelsize" target="pattern" compare="not_eq">
    <double>-1.0</double>
  </test>

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is a bug assignee.
https://bugs.launchpad.net/bugs/190848

Title:
  font in terminal does not resemble font in preview

To manage notifications about this bug go to:
https://bugs.launchpad.net/fontconfig/+bug/190848/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to