I was playing around with ~/.fonts.conf and added the following errorneous rule: <match target="font"> <test name="family"><string>Lucida</string></test> <edit name="family" mode="prepend"><bool>sans-serif</bool></edit> </match> Note <bool>sans-serif</bool>. It should actually be <string>sans-serif</string>. I only noticed the mistake a month or so later, when I started to investigate mysterious Gtk+ application crashes in the font selection dialog. The symptoms included the following appearing in stderr: ** ERROR **: file pangofc-fontmap.cI: line 868 (_pango_xft_font_desc_from_pattern): assertion failed: (FcPatternGetString (pattern, FC_FAMILY, 0, (FcChar8 **) &s) == FcResultMatch) aborting... See http://bugzilla.gnome.org/show_bug.cgi?id=134113 for more details. Fontconfig should detect and loudly complain about such mistakes in configuration files rather than causing hard-to-diagnose trouble later on in different components.
Thanks for the useful bug report. I've gone ahead and added some polite typechecking to the configuration file code. With the example given, fontconfig emits the following warnings: Fontconfig warning: "~/.fonts.conf", line 139: "sans-serif" is not known boolean Fontconfig warning: "~/.fonts.conf", line 139: saw bool, expected string The first warning says that in <bool>sans-serif</bool>, the 'sans-serif' string isn't understood as a boolean value. The second warning says that "family" expects a string value, not a boolean value. Does this look reasonable to you?
It's more than reasonable, thanks!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.