X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fdf7514a009227ebf09cf8e184b3d96aa33eb026..89438177fec0509014695b40808e7e8dc3219c7d:/src/unix/fontutil.cpp diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 79f36b31dd..6599fa5e71 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -57,15 +57,16 @@ void wxNativeFontInfo::Init() description = NULL; } -wxNativeFontInfo::wxNativeFontInfo(const wxNativeFontInfo& info) +void +wxNativeFontInfo::Init(const wxNativeFontInfo& info) { if (info.description) description = pango_font_description_copy(info.description); else - description = NULL; + description = NULL; } -wxNativeFontInfo::~wxNativeFontInfo() +void wxNativeFontInfo::Free() { if (description) pango_font_description_free(description); @@ -236,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 @@ -724,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;