X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/670f9935630beb2123a5ca62894ae92a3f0efa4f..1be2473f5909d77ec93070d390429d92f3e47298:/src/unix/fontenum.cpp?ds=sidebyside diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp index 71ba6d7849..e09f06170e 100644 --- a/src/unix/fontenum.cpp +++ b/src/unix/fontenum.cpp @@ -26,10 +26,10 @@ #include "wx/dynarray.h" #include "wx/string.h" #include "wx/app.h" + #include "wx/utils.h" #endif #include "wx/regex.h" -#include "wx/utils.h" #include "wx/fontmap.h" #include "wx/fontutil.h" #include "wx/encinfo.h" @@ -56,20 +56,26 @@ wxCompareFamilies (const void *a, const void *b) return g_utf8_collate (a_name, b_name); } -// I admit I don't yet understand encodings with Pango 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 + else // !fixedWidthOnly #endif // __WXGTK20__ || !HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE { PangoFontFamily **families = NULL; @@ -104,14 +110,13 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, return true; } -bool wxFontEnumerator::EnumerateEncodings(const wxString& family) +bool wxFontEnumerator::EnumerateEncodings(const wxString& facename) { - return false; + return EnumerateEncodingsUTF8(facename); } -#else - // Pango +#else // !wxUSE_PANGO #ifdef __VMS__ // Xlib.h for VMS is not (yet) compatible with C++ // The resulting warnings are switched off here