]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/font.cpp
Added conversion of menu labels (&->~)
[wxWidgets.git] / src / gtk / font.cpp
index a4861030902b111ea2e0bc23f3203ed95b2b5831..02d61bff580b28bb29ae61ea54ee99fae35fa8ac 100644 (file)
@@ -166,6 +166,7 @@ wxFont::wxFont( const wxString& fontname, const wxFontData& fontdata )
 
     wxStringTokenizer tn( fontname, wxT("-") );
 
+    tn.GetNextToken();                           // skip initial empty token
     tn.GetNextToken();                           // foundry
 
     M_FONTDATA->m_faceName = tn.GetNextToken();  // family
@@ -398,7 +399,16 @@ static GdkFont *GtkGetDefaultGuiFont()
     {
         GtkWidget *widget = gtk_button_new();
         GtkStyle *def = gtk_rc_get_style( widget );
-        g_systemDefaultGuiFont = gdk_font_ref( def->font );
+        if (def)
+        {
+            g_systemDefaultGuiFont = gdk_font_ref( def->font );
+        }
+        else
+        {
+            def = gtk_widget_get_default_style();
+            if (def)
+                g_systemDefaultGuiFont = gdk_font_ref( def->font );
+        }
         gtk_widget_destroy( widget );
     }
     return g_systemDefaultGuiFont;
@@ -428,7 +438,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const
         {
             font = GtkGetDefaultGuiFont();
         }
-        else
+        if (!font)
         {
             font = wxLoadQueryNearestFont( point_scale,
                                            M_FONTDATA->m_family,