Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 9a71895abfb6f490d4fa44e008936a18 > files > 12

gtk+-1.2.10-50mdv2009.0.src.rpm

--- gtk+-1.2.10/gdk/gdkfont.c.fontwarning	2002-07-30 15:38:52.000000000 +0200
+++ gtk+-1.2.10/gdk/gdkfont.c	2002-07-30 15:43:43.000000000 +0200
@@ -26,6 +26,8 @@
 
 #include <X11/Xlib.h>
 #include <X11/Xos.h>
+#include <langinfo.h>
+#include <locale.h>
 #include "gdk.h"
 #include "gdkprivate.h"
 
@@ -173,9 +175,26 @@
   if (missing_charset_count)
     {
       gint i;
-      g_warning ("Missing charsets in FontSet creation\n");
-      for (i=0;i<missing_charset_count;i++)
-	g_warning ("    %s\n", missing_charset_list[i]);
+      const char *codeset;
+
+      codeset = nl_langinfo (CODESET);
+
+      /* Hack - UTF-8 is likely to be rendered with a list of
+       * possible legacy fallback charsets, so a failure here
+       * shouldn't be warned about. But we don't want to suppress
+       * this warning in general, since for other character sets
+       * it gives a useful indication of what went wrong.
+       */
+      if (g_strcasecmp (codeset, "utf-8") != 0 &&
+	  g_strcasecmp (codeset, "utf8") != 0)
+	{
+	  g_printerr ("The font \"%s\" does not support all the required character sets for the current locale \"%s\"\n",
+		      fontset_name, setlocale (LC_ALL, NULL));
+	  for (i=0;i<missing_charset_count;i++)
+	    g_printerr ("  (Missing character set \"%s\")\n",
+ 			missing_charset_list[i]);
+	}
+      
       XFreeStringList (missing_charset_list);
     }