From 7eb5dfd2947c8e8de0957f4339af66b47811f2c7 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 --- gtk/inspector/general.c | 24 ++++++++++++++++++++++++ gtk/inspector/general.ui | 28 ++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c index f492af2f0b..977671b749 100644 --- a/gtk/inspector/general.c +++ b/gtk/inspector/general.c @@ -71,6 +71,7 @@ struct _GtkInspectorGeneralPrivate GtkWidget *gtk_version; GtkWidget *gdk_backend; GtkWidget *gsk_renderer; + GtkWidget *pango_fontmap; GtkWidget *gl_version; GtkWidget *gl_vendor; GtkWidget *vk_device; @@ -625,6 +626,27 @@ init_display (GtkInspectorGeneral *gen) populate_display (display, 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 @@ -793,6 +815,7 @@ gtk_inspector_general_init (GtkInspectorGeneral *gen) init_version (gen); init_env (gen); init_display (gen); + init_pango (gen); init_gl (gen); init_vulkan (gen); init_device (gen); @@ -924,6 +947,7 @@ gtk_inspector_general_class_init (GtkInspectorGeneralClass *klass) 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, gsk_renderer); + gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, pango_fontmap); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gl_version); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gl_vendor); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, vk_device); diff --git a/gtk/inspector/general.ui b/gtk/inspector/general.ui index 349c2f49cf..4651befc9b 100644 --- a/gtk/inspector/general.ui +++ b/gtk/inspector/general.ui @@ -96,6 +96,33 @@ + + + 0 + + + 10 + 40 + + + Pango Fontmap + start + baseline + 0.0 + + + + + 1 + end + baseline + 1 + + + + + + @@ -578,6 +605,7 @@ +