]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/fontutil.cpp
Get the stock label when stock ID is used with empty label in Create()
[wxWidgets.git] / src / unix / fontutil.cpp
index c6bc4f93a26fe22977211300c59bcd5eb3f82f49..6599fa5e7114c93a99558c86b777d2a4ae01a0b3 100644 (file)
@@ -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