[gtk+] tests: Stop using gdk_pango_get_context_for_display
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] tests: Stop using gdk_pango_get_context_for_display
- Date: Tue, 31 Oct 2017 22:16:54 +0000 (UTC)
commit 1641ef4799bab044d5254202e05c5007dc3afed7
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Oct 31 18:14:08 2017 -0400
tests: Stop using gdk_pango_get_context_for_display
This api is going away.
tests/rendernode-create-tests.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/tests/rendernode-create-tests.c b/tests/rendernode-create-tests.c
index 7990824..5139f50 100644
--- a/tests/rendernode-create-tests.c
+++ b/tests/rendernode-create-tests.c
@@ -362,9 +362,16 @@ text (guint n)
PangoFontDescription *desc;
PangoContext *context;
PangoLayout *layout;
+ GtkSettings *settings;
+ int dpi_int;
int i;
- context = gdk_pango_context_get_for_display (gdk_display_get_default ());
+ context = pango_font_map_create_context (pango_cairo_font_map_get_default ());
+
+ settings = gtk_settings_get_default ();
+ g_object_get (settings, "gtk-xft-dpi", &dpi_int, NULL);
+ if (dpi_int > 0)
+ pango_cairo_context_set_resolution (context, dpi_int / 1024.);
desc = pango_font_description_new ();
pango_font_description_set_family (desc, "Cantarell");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]