pango r2753 - in trunk: . pango



Author: behdad
Date: Mon Dec  8 03:53:12 2008
New Revision: 2753
URL: http://svn.gnome.org/viewvc/pango?rev=2753&view=rev

Log:
2008-12-07  Behdad Esfahbod  <behdad gnome org>

        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.

Modified:
   trunk/ChangeLog
   trunk/pango/fonts.c
   trunk/pango/pangofc-fontmap.c

Modified: trunk/pango/fonts.c
==============================================================================
--- trunk/pango/fonts.c	(original)
+++ trunk/pango/fonts.c	Mon Dec  8 03:53:12 2008
@@ -1084,7 +1084,23 @@
 
   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;
     }
 

Modified: trunk/pango/pangofc-fontmap.c
==============================================================================
--- trunk/pango/pangofc-fontmap.c	(original)
+++ trunk/pango/pangofc-fontmap.c	Mon Dec  8 03:53:12 2008
@@ -845,11 +845,8 @@
 
   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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]