Bug 499624 – Spaces around commas in PangoFontDescription family name
should be trimmed
+ * pango/fonts.c (pango_font_description_from_string):
+ * pango/pangofc-fontmap.c (pango_fc_make_pattern):
+ Do it in pango_font_description_from_string() instead of pangofc
+ backend.
+
+2008-12-07 Behdad Esfahbod <behdad@gnome.org>
+
+ Bug 499624 – Spaces around commas in PangoFontDescription family name
+ should be trimmed
+
* pango/pangofc-fontmap.c (pango_fc_make_pattern): Trim family strings
before adding to pattern.
if (str != last)
{
+ int i;
+ char **families;
+
desc->family_name = g_strndup (str, last - str);
+
+ /* Now sanitize it to trim space from around individual family names.
+ * bug #499624 */
+
+ families = g_strsplit (desc->family_name, ",", -1);
+
+ for (i = 0; families[i]; i++)
+ g_strstrip (families[i]);
+
+ g_free (desc->family_name);
+ desc->family_name = g_strjoinv (",", families);
+ g_strfreev (families);
+
desc->mask |= PANGO_FONT_MASK_FAMILY;
}
families = g_strsplit (pango_font_description_get_family (description), ",", -1);
- for (i = 0; families[i]; i++) {
- char *family = pango_trim_string (families[i]);
- FcPatternAddString (pattern, FC_FAMILY, family);
- g_free (family);
- }
+ for (i = 0; families[i]; i++)
+ FcPatternAddString (pattern, FC_FAMILY, families[i]);
g_strfreev (families);