From 22dd7189bb84bb2a4f3e88d49fed9fda8e6c0f03 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 28 Jul 2019 11:39:16 -0400 Subject: [PATCH] inspector: Show the pango backend (cherry picked from commit 7eb5dfd2947c8e8de0957f4339af66b47811f2c7) --- gtk/inspector/general.c | 24 ++++++++++++++++++++++++ gtk/inspector/general.ui | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c index 4fd0c3039c..3c2c7056ee 100644 --- a/gtk/inspector/general.c +++ b/gtk/inspector/general.c @@ -62,6 +62,7 @@ struct _GtkInspectorGeneralPrivate GtkWidget *device_box; GtkWidget *gtk_version; GtkWidget *gdk_backend; + GtkWidget *pango_fontmap; GtkWidget *app_id_frame; GtkWidget *app_id; GtkWidget *resource_path; @@ -500,6 +501,27 @@ init_display (GtkInspectorGeneral *gen) populate_display (screen, gen); } +static void +init_pango (GtkInspectorGeneral *gen) +{ + PangoFontMap *fontmap; + const char *type; + const char *name; + + fontmap = pango_cairo_font_map_get_default (); + type = G_OBJECT_TYPE_NAME (fontmap); + if (strcmp (type, "PangoCairoFcFontMap") == 0) + name = "fontconfig"; + else if (strcmp (type, "PangoCairoCoreTextFontMap") == 0) + name = "coretext"; + else if (strcmp (type, "PangoCairoWin32FontMap") == 0) + name = "win32"; + else + name = type; + + gtk_label_set_label (GTK_LABEL (gen->priv->pango_fontmap), name); +} + static void populate_seats (GtkInspectorGeneral *gen); static void @@ -670,6 +692,7 @@ gtk_inspector_general_init (GtkInspectorGeneral *gen) init_app_id (gen); init_env (gen); init_display (gen); + init_pango (gen); init_gl (gen); init_device (gen); } @@ -757,6 +780,7 @@ gtk_inspector_general_class_init (GtkInspectorGeneralClass *klass) gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gl_box); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gtk_version); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gdk_backend); + gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, pango_fontmap); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, app_id_frame); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, app_id); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, resource_path); diff --git a/gtk/inspector/general.ui b/gtk/inspector/general.ui index f57771c453..bd5e9c09d3 100644 --- a/gtk/inspector/general.ui +++ b/gtk/inspector/general.ui @@ -86,6 +86,40 @@ + + + True + False + + + True + horizontal + 10 + 40 + + + True + Pango Fontmap + start + baseline + 0.0 + + + + + True + True + end + baseline + + + True + + + + + + @@ -650,6 +684,7 @@ +