summaryrefslogtreecommitdiffstats
path: root/x11-libs/gtk+/files/gtk+-1.2.10-rh-fontwarning.patch
blob: c3f6b27c9cadd0ebf5e9fdb4b7353a9f7d379380 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- 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);
     }