X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/550343399aa1355469ffed72c8cf84c732dcf98b..b6b59e43ca3972b4b3d30f0e75440870410dc321:/src/unix/fontutil.cpp diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 84c7abec5d..b1eda856d4 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -304,7 +304,7 @@ wxString wxNativeFontInfo::ToUserString() const // wxNativeEncodingInfo // ---------------------------------------------------------------------------- -bool wxNativeEncodingInfo::FromString(const wxString& s) +bool wxNativeEncodingInfo::FromString(const wxString& WXUNUSED(s)) { return false; } @@ -314,7 +314,7 @@ wxString wxNativeEncodingInfo::ToString() const return wxEmptyString; } -bool wxTestFontEncoding(const wxNativeEncodingInfo& info) +bool wxTestFontEncoding(const wxNativeEncodingInfo& WXUNUSED(info)) { return true; } @@ -322,17 +322,25 @@ bool wxTestFontEncoding(const wxNativeEncodingInfo& info) bool wxGetNativeFontEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info) { - // we *must* return true for default encoding as otherwise wxFontMapper - // considers that we can't load any font and aborts with wxLogFatalError! - if ( encoding == wxFONTENCODING_SYSTEM ) + info->facename.clear(); + + switch ( encoding ) { - info->facename.clear(); - info->encoding = wxFONTENCODING_SYSTEM; - } + // 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; - // pretend that we support everything, it's better than to always return - // false as the old code did - return true; + case wxFONTENCODING_UTF8: + info->encoding = wxFONTENCODING_UTF8; + return true; + + default: + // everything else must be converted to UTF-8 + return false; + } } #else // GTK+ 1.x