X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/23afe648cebb471ce620528fbeb8bfd2f25849fc..5f3565a2fb3d678b03cf8547f37e56b1efe786f5:/src/unix/fontutil.cpp diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index ddbf06d0cf..6599fa5e71 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -63,10 +63,10 @@ wxNativeFontInfo::Init(const wxNativeFontInfo& info) if (info.description) description = pango_font_description_copy(info.description); else - description = NULL; + description = NULL; } -wxNativeFontInfo::Free() +void wxNativeFontInfo::Free() { if (description) pango_font_description_free(description); @@ -237,7 +237,17 @@ bool wxTestFontEncoding(const wxNativeEncodingInfo& info) bool wxGetNativeFontEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info) { - return FALSE; + // 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(); + info->encoding = wxFONTENCODING_SYSTEM; + } + + // pretend that we support everything, it's better than to always return + // false as the old code did + return true; } #else // GTK+ 1.x @@ -725,7 +735,7 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding, break; case wxFONTENCODING_GB2312: - info->xregistry = wxT("GB2312"); // or the otherway round? + info->xregistry = wxT("GB2312"); // or the otherway round? info->xencoding = wxT("*"); break;