PangoFontDescription *font_desc;
gint row_height;
- font_desc = pango_font_description_copy_static(gtk_widget_get_style(widget)->font_desc);
+ font_desc = pango_font_description_copy_static(ghb_widget_get_font(widget));
pango_font_description_merge_static(font_desc, celltext->font, TRUE);
if (celltext->scale_set)
}
#endif
+static inline PangoFontDescription* ghb_widget_get_font(GtkWidget *widget)
+{
+ PangoFontDescription *font = NULL;
+
+#if GTK_CHECK_VERSION(3, 0, 0)
+ GtkStyleContext *style;
+
+ style = gtk_widget_get_style_context(widget);
+
+#if GTK_CHECK_VERSION(3, 8, 0)
+ gtk_style_context_get(style, GTK_STATE_FLAG_NORMAL,
+ "font", &font, NULL);
+#else
+ font = gtk_style_context_get_font(style, GTK_STATE_FLAG_NORMAL);
+#endif
+
+#else
+ font = gtk_widget_get_style(widget)->font_desc;
+#endif
+
+ return font;
+}
+
#if !GTK_CHECK_VERSION(3, 0, 0)
#define gtk_widget_override_font gtk_widget_modify_font
#endif