X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5f11fef5435283f9d2465f7eaccdd72d2f3fb1ef..9c8cfcb9c56798ebd29184e40227451a194c0c49:/src/unix/fontutil.cpp diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index c29cc1aaf0..2d04279540 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -27,12 +27,13 @@ #ifndef WX_PRECOMP #include "wx/font.h" // wxFont enums #include "wx/encinfo.h" + #include "wx/hash.h" + #include "wx/utils.h" // for wxGetDisplay() #endif // PCH #include "wx/fontutil.h" #include "wx/fontmap.h" #include "wx/tokenzr.h" -#include "wx/hash.h" #include "wx/module.h" #if wxUSE_PANGO @@ -322,27 +323,12 @@ bool wxTestFontEncoding(const wxNativeEncodingInfo& WXUNUSED(info)) bool wxGetNativeFontEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info) { + // all encodings are available in GTK+ 2 because we translate text in any + // encoding to UTF-8 internally anyhow info->facename.clear(); + info->encoding = encoding; - switch ( encoding ) - { - // we *must* return true for default encodings as otherwise wxFontMapper - // considers that we can't load any font and aborts with wxLogFatalError! - case wxFONTENCODING_DEFAULT: - case wxFONTENCODING_SYSTEM: - info->encoding = wxFONTENCODING_SYSTEM; - return true; - - case wxFONTENCODING_ISO8859_1: - case wxFONTENCODING_UTF8: - // these are always supported by GTK+ 2 - info->encoding = encoding; - return true; - - default: - // everything else must be converted to UTF-8 - return false; - } + return true; } #else // GTK+ 1.x @@ -358,7 +344,6 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding, #pragma message enable nosimpint #endif - #include "wx/utils.h" // for wxGetDisplay() #elif defined(__WXGTK__) // we have to declare struct tm to avoid problems with first forward // declaring it in C code (glib.h included from gdk.h does it) and then