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
This commit is contained in:
parent
51b0044648
commit
1fbb0b3b15
|
@ -594,6 +594,10 @@ FcTypecheckValue (FcConfigParse *parse, FcType value, FcType type)
|
||||||
return;
|
return;
|
||||||
if (type == (FcType) -1)
|
if (type == (FcType) -1)
|
||||||
return;
|
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",
|
FcConfigMessage (parse, FcSevereWarning, "saw %s, expected %s",
|
||||||
FcTypeName (value), FcTypeName (type));
|
FcTypeName (value), FcTypeName (type));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue