X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/de6185e212ebc37ff11ff70278e3c4f68419b097..5a1e0e91a1ca5ec98b0eeb335cda757d1261ed08:/src/unix/fontenum.cpp diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp index 3e0766599a..dc50c9b740 100644 --- a/src/unix/fontenum.cpp +++ b/src/unix/fontenum.cpp @@ -20,6 +20,8 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_FONTENUM + #include "wx/fontenum.h" #ifndef WX_PRECOMP @@ -56,20 +58,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 +112,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 @@ -355,3 +362,5 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family) } #endif // !wxUSE_PANGO + +#endif // wxUSE_FONTENUM