X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c79853685d09ba1d7eaef604395c40b731ed2f34..79f585d90388128f9d245f7c92d3013b98b9ed14:/src/gtk1/font.cpp?ds=sidebyside diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index a486103090..5e9d1ce629 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -398,7 +398,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 +437,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const { font = GtkGetDefaultGuiFont(); } - else + if (!font) { font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_family,