- wxFontFamily ret = wxFONTFAMILY_DEFAULT;
- char *family_text = g_ascii_strdown( pango_font_description_get_family( description ), -1 );
- // 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)
+ wxFontFamily ret = wxFONTFAMILY_UNKNOWN;
+
+ const char *family_name = pango_font_description_get_family( description );
+
+ // 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.
+ 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 (wxStrnicmp( family_text, "monospace", 9 ) == 0)
+ ret = wxFONTFAMILY_TELETYPE; // begins with "Monospace"
+ else if (wxStrnicmp( family_text, "courier", 7 ) == 0)
+ ret = wxFONTFAMILY_TELETYPE; // begins with "Courier"
+#if defined(__WXGTK20__) || defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)