[gtk/pango2] fontexplorer: Show the font file in the info tab



commit 113583c28e618d04bab1492fc5ae1b60a0629a3c
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jul 10 10:30:57 2022 -0400

    fontexplorer: Show the font file in the info tab
    
    This is useful, and pango2 lets us do it easily.
    And we can stop sneaking this information into
    a tooltip.

 demos/font-explorer/fontexplorerwin.c | 1 -
 demos/font-explorer/infoview.c        | 7 +++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/demos/font-explorer/fontexplorerwin.c b/demos/font-explorer/fontexplorerwin.c
index 64e6de4855..ed53f98e11 100644
--- a/demos/font-explorer/fontexplorerwin.c
+++ b/demos/font-explorer/fontexplorerwin.c
@@ -258,7 +258,6 @@ font_explorer_window_load (FontExplorerWindow *self,
   gtk_widget_hide (GTK_WIDGET (self->fontbutton));
   gtk_widget_show (GTK_WIDGET (self->path));
   gtk_label_set_label (self->path, basename);
-  gtk_widget_set_tooltip_text (GTK_WIDGET (self->path), path);
 
   pango2_font_description_free (desc);
   g_free (basename);
diff --git a/demos/font-explorer/infoview.c b/demos/font-explorer/infoview.c
index 40464bf397..11c7c69353 100644
--- a/demos/font-explorer/infoview.c
+++ b/demos/font-explorer/infoview.c
@@ -120,6 +120,7 @@ add_misc_line (InfoView   *self,
   gtk_label_set_wrap (GTK_LABEL (label), TRUE);
   gtk_label_set_width_chars (GTK_LABEL (label), 40);
   gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
+  gtk_label_set_selectable (GTK_LABEL (label), TRUE);
   gtk_grid_attach (self->info, label, 1, row, 1, 1);
 }
 
@@ -184,6 +185,7 @@ update_info (InfoView *self)
   unsigned int count;
   GString *s;
   hb_tag_t *tables;
+  const char *path;
 
   hb_font_set_scale (font, hb_face_get_upem (face), hb_face_get_upem (face));
 
@@ -191,6 +193,11 @@ update_info (InfoView *self)
     gtk_widget_unparent (child);
 
   gtk_grid_attach (self->info, make_title_label ("General Info"), 0, row++, 2, 1);
+
+  path = pango2_hb_face_get_file (PANGO2_HB_FACE (pango2_font_get_face (pango_font)));
+  if (path)
+    add_misc_line (self, "File ", path, row++);
+
   add_info_line (self, face, HB_OT_NAME_ID_FONT_FAMILY, "Font Family Name", row++);
   add_info_line (self, face, HB_OT_NAME_ID_FONT_SUBFAMILY, "Font Subfamily Name", row++);
   add_info_line (self, face, HB_OT_NAME_ID_UNIQUE_ID, "Unique Font Identifier", row++);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]