I was playing around with ~/.fonts.conf and added the following errorneous rule:
<edit name="family" mode="prepend"><bool>sans-serif</bool></edit>
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)
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
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!