]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/fontutil.cpp
Incomplete setup build fix.
[wxWidgets.git] / src / unix / fontutil.cpp
index ddbf06d0cf9388b7150b699bc0dae623229ae8ec..6599fa5e7114c93a99558c86b777d2a4ae01a0b3 100644 (file)
@@ -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;