]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/fontutil.cpp
Added wxAutoNSAutoreleasePool to DoGetBestSize method
[wxWidgets.git] / src / unix / fontutil.cpp
index beac3babe431e704849ca90a38f6a99dedcb4e93..e1521328fca140588fef7bb2566652b12c1ae464 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     05.11.99
 // RCS-ID:      $Id$
 // Copyright:   (c) Vadim Zeitlin
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -235,7 +235,10 @@ static wxHashTable *g_fontHash = (wxHashTable*) NULL;
 #elif defined(__WXGTK__)
     wxNativeFont wxLoadFont(const wxString& fontSpec)
     {
-       return gdk_font_load( wxConvertWX2MB(fontSpec) );
+        // use gdk_fontset_load() instead of gdk_font_load() because otherwise
+        // we have problems with Japanese (not terribly precise, I know, but
+        // this is all the patch said)
+        return gdk_fontset_load( wxConvertWX2MB(fontSpec) );
     }
 
     inline void wxFreeFont(wxNativeFont font)
@@ -388,16 +391,20 @@ bool wxNativeFontInfo::FromXFontName(const wxString& fontname)
             return FALSE;
         }
 
-        fontElements[n] = tokenizer.GetNextToken();
+        wxString field = tokenizer.GetNextToken();
+        if ( !field.empty() && field != _T('*') )
+        {
+            // we're really initialized now
+            m_isDefault = FALSE;
+        }
+
+        fontElements[n] = field;
     }
 
     // this should be all
     if ( tokenizer.HasMoreTokens() )
         return FALSE;
 
-    // we're initialized now
-    m_isDefault = FALSE;
-
     return TRUE;
 }