+bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
+ bool fixedWidthOnly)
+{
+ if ( encoding != wxFONTENCODING_SYSTEM && encoding != wxFONTENCODING_UTF8 )
+ {
+ // Pango supports only UTF-8 encoding (and system means any, so we
+ // accept it too)
+ return false;
+ }
+
+#if defined(__WXGTK20__) || !defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
+ if ( fixedWidthOnly
+#if defined(__WXGTK24__)
+ && (gtk_check_version(2,4,0) != NULL)
+#endif
+ )
+ {
+ OnFacename( wxT("monospace") );
+ }
+ else // !fixedWidthOnly
+#endif // __WXGTK20__ || !HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
+ {
+ PangoFontFamily **families = NULL;
+ gint n_families = 0;
+ pango_context_list_families (
+#ifdef __WXGTK20__
+ gtk_widget_get_pango_context( wxGetRootWindow() ),
+#else
+ wxTheApp->GetPangoContext(),
+#endif
+ &families, &n_families );
+ qsort (families, n_families, sizeof (PangoFontFamily *), wxCompareFamilies);
+
+ for (int i=0; i<n_families; i++)
+ {
+#if defined(__WXGTK24__) || defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
+ if (!fixedWidthOnly || (
+#ifdef __WXGTK24__
+ !gtk_check_version(2,4,0) &&
+#endif
+ pango_font_family_is_monospace(families[i])
+ ) )
+#endif
+ {
+ const gchar *name = pango_font_family_get_name(families[i]);
+ OnFacename(wxString(name, wxConvUTF8));
+ }
+ }
+ g_free(families);
+ }
+
+ return true;
+}
+
+bool wxFontEnumerator::EnumerateEncodings(const wxString& facename)
+{
+ return EnumerateEncodingsUTF8(facename);
+}
+
+
+#else // !wxUSE_PANGO
+
+#ifdef __VMS__ // Xlib.h for VMS is not (yet) compatible with C++
+ // The resulting warnings are switched off here
+#pragma message disable nosimpint
+#endif