diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2012-12-30 19:08:42 -0600 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2012-12-30 19:08:42 -0600 |
commit | 1fbb0b3b15774c187c697a80fb3c89bc1f3e0006 (patch) | |
tree | a8f40a45e26e532701922992544e7fafb04d823b | |
parent | 51b0044648e00025cf20014b19aaceed7beeed75 (diff) |
Don't warn if an unknown element is used in an expression
The type will be resolved at runtime...
For example, we can do this now without getting a warning:
<match target="font">
<test name="scalable" compare="eq">
<bool>false</bool>
</test>
<edit name="pixelsizefixupfactor" mode="assign">
<divide>
<name target="pattern">pixelsize</name>
<name target="font" >pixelsize</name>
</divide>
</edit>
<edit name="matrix" mode="assign">
<times>
<name>matrix</name>
<matrix>
<name>pixelsizefixupfactor</name> <double>0</double>
<double>0</double> <name>pixelsizefixupfactor</name>
</matrix>
</times>
</edit>
<edit name="size" mode="assign">
<divide>
<name>size</name>
<name>pixelsizefixupfactor</name>
</divide>
</edit>
</match>
Previously the last edit was generating:
Fontconfig warning: "/home/behdad/.local/etc/fonts/conf.d/00-scale-bitmap-fonts.conf", line 29: saw unknown, expected number
-rw-r--r-- | src/fcxml.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fcxml.c b/src/fcxml.c index d31caf5..cf9c8dd 100644 --- a/src/fcxml.c +++ b/src/fcxml.c @@ -594,6 +594,10 @@ FcTypecheckValue (FcConfigParse *parse, FcType value, FcType type) return; if (type == (FcType) -1) return; + /* It's perfectly fine to use user-define elements in expressions, + * so don't warn in that case. */ + if (value == (FcType) -1) + return; FcConfigMessage (parse, FcSevereWarning, "saw %s, expected %s", FcTypeName (value), FcTypeName (type)); } |