-#ifndef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
- if (g_ascii_strcasecmp( pango_font_description_get_family( description ), "monospace" ) == 0)
- return wxFONTFAMILY_TELETYPE;
-#else
-
- PangoFontFamily **families;
- PangoFontFamily *family;
- int n_families;
- pango_context_list_families(
+ wxFontFamily ret = wxFONTFAMILY_DEFAULT;
+ // note: not passing -1 as the 2nd parameter to g_ascii_strdown to work
+ // around a bug in the 64-bit glib shipped with solaris 10, -1 causes it
+ // to try to allocate 2^32 bytes.
+ const char *family_name = pango_font_description_get_family( description );
+ if ( !family_name )
+ return ret;
+
+ wxGtkString family_text(g_ascii_strdown(family_name, strlen(family_name)));
+
+ // Check for some common fonts, to salvage what we can from the current win32 centric wxFont API:
+ if (strncmp( family_text, "monospace", 9 ) == 0)
+ ret = wxFONTFAMILY_TELETYPE; // begins with "Monospace"
+ else if (strncmp( family_text, "courier", 7 ) == 0)
+ ret = wxFONTFAMILY_TELETYPE; // begins with "Courier"
+#if defined(__WXGTK24__) || defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
+ else
+#ifdef __WXGTK24__
+ if (!gtk_check_version(2,4,0))
+#endif
+ {
+ PangoFontFamily **families;
+ PangoFontFamily *family = NULL;
+ int n_families;
+ pango_context_list_families(