+static GdkFont *g_systemDefaultGuiFont = (GdkFont*) NULL;
+
+GdkFont *GtkGetDefaultGuiFont()
+{
+ if (!g_systemDefaultGuiFont)
+ {
+ GtkWidget *widget = gtk_button_new();
+ GtkStyle *def = gtk_rc_get_style( widget );
+ 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 );
+ }
+ else
+ {
+ // already have it, but ref it once more before returning
+ gdk_font_ref(g_systemDefaultGuiFont);
+ }
+
+ return g_systemDefaultGuiFont;
+}
+