... instead of soon-to-be-deprecated gtk_style_context_get_font().
style_context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
- font_desc = pango_font_description_copy_static (gtk_style_context_get_font (style_context, state));
+ gtk_style_context_get (style_context, state, "font", &font_desc, NULL);
pango_font_description_merge_static (font_desc, priv->font, TRUE);
if (priv->scale_set)
if (values->font)
pango_font_description_free (values->font);
- values->font = pango_font_description_copy (gtk_style_context_get_font (context, state));
+ gtk_style_context_get (context, state, "font", &values->font, NULL);
}
cairo_surface_t *
if (values->font)
pango_font_description_free (values->font);
- values->font = pango_font_description_copy (gtk_style_context_get_font (context, state));
+ gtk_style_context_get (context, state, "font", &values->font, NULL);
gtk_style_context_restore (context);
}
update_pango_context (GtkWidget *widget,
PangoContext *context)
{
- const PangoFontDescription *font_desc;
+ PangoFontDescription *font_desc;
GtkStyleContext *style_context;
style_context = gtk_widget_get_style_context (widget);
-
- font_desc = gtk_style_context_get_font (style_context,
- gtk_widget_get_state_flags (widget));
+ gtk_style_context_get (style_context,
+ gtk_widget_get_state_flags (widget),
+ "font", &font_desc,
+ NULL);
pango_context_set_font_description (context, font_desc);
pango_context_set_base_dir (context,
gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL);
+
+ pango_font_description_free (font_desc);
}
static void