Index: font-view.c
===================================================================
--- font-view.c	(revision 8127)
+++ font-view.c	(working copy)
@@ -32,6 +32,7 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
+#include <libgnome/libgnome.h>
 #include <libgnomevfs/gnome-vfs.h>
 #include <libgnomevfs/gnome-vfs-mime-handlers.h>
 #include <libgnomeui/gnome-icon-lookup.h>
@@ -159,7 +160,7 @@ create_text_pixmap(GtkWidget *drawing_ar
     /* calculate size of pixmap to use (with 4 pixels padding) ... */
     pixmap_width = 8;
     pixmap_height = 8;
-    
+
     font = get_font(xdisplay, face, alpha_size, charset);
     charset = FcCharSetCopy (font->charset);
     XftTextExtentsUtf8(xdisplay, font,
@@ -222,8 +223,8 @@ create_text_pixmap(GtkWidget *drawing_ar
 }
 
 static void
-add_row(GtkWidget *table, gint *row_p,
-	const gchar *name, const gchar *value, gboolean multiline)
+add_row (GtkTable *table, gint *row_p,
+	 const gchar *name, const gchar *value, gboolean multiline)
 {
     gchar *bold_name;
     GtkWidget *name_w, *value_w;
@@ -256,18 +257,56 @@ add_row(GtkWidget *table, gint *row_p,
 	value_w = gtk_label_new(value);
 	gtk_misc_set_alignment(GTK_MISC(value_w), 0.0, 0.5);
 	gtk_label_set_selectable(GTK_LABEL(value_w), TRUE);
+	gtk_label_set_line_wrap (GTK_LABEL (value_w), TRUE);
     }
 
-    gtk_table_attach(GTK_TABLE(table), name_w, 0, 1, *row_p, *row_p + 1,
+    gtk_table_attach(table, name_w, 0, 1, *row_p, *row_p + 1,
 		     GTK_FILL, GTK_FILL, 0, 0);
-    gtk_table_attach(GTK_TABLE(table), value_w, 1, 2, *row_p, *row_p + 1,
+    gtk_table_attach(table, value_w, 1, 2, *row_p, *row_p + 1,
 		     GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
 
     (*row_p)++;
 }
 
 static void
-add_face_info(GtkWidget *table, gint *row_p, const gchar *uri, FT_Face face)
+open_url (GtkWidget *widget,
+	  gpointer   data)
+{
+    const gchar *link;
+    link = gtk_link_button_get_uri (GTK_LINK_BUTTON (widget));
+    gnome_url_show (link, NULL);
+}
+
+static void
+add_row_url (GtkTable *table, gint *row_p,
+             const gchar *name, const gchar *value, gboolean multiline)
+{
+    gchar *bold_name;
+    GtkWidget *label;
+    GtkWidget *button;
+
+    bold_name = g_strconcat ("<b>", name, "</b>", NULL);
+    label = gtk_label_new (bold_name);
+    g_free (bold_name);
+    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+    gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+
+    button = gtk_link_button_new (value);
+    g_signal_connect (button, "clicked",
+		      G_CALLBACK (open_url), NULL);
+
+    gtk_button_set_alignment (GTK_BUTTON (button), 0.0, 0.0);
+
+    gtk_table_attach (table, label, 0, 1, *row_p, *row_p + 1,
+		      GTK_FILL, GTK_FILL, 0, 0);
+    gtk_table_attach (table, button, 1, 2, *row_p, *row_p + 1,
+		      GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
+
+    ++(*row_p);
+}
+
+static void
+add_face_info (GtkTable *table, gint *row_p, const gchar *uri, FT_Face face)
 {
     GnomeVFSFileInfo *file_info;
     GnomeVFSResult res;
@@ -300,7 +339,9 @@ add_face_info(GtkWidget *table, gint *ro
 
     if (FT_IS_SFNT(face)) {
 	gint i, len;
-	gchar *version = NULL, *copyright = NULL, *description = NULL;
+	gchar *version = NULL, *copyright = NULL, *license = NULL,
+		  *license_url = NULL, *designer = NULL, *designer_url = NULL,
+		  *trademark = NULL, *description = NULL;
 
 	len = FT_Get_Sfnt_Name_Count(face);
 	for (i = 0; i < len; i++) {
@@ -316,15 +357,40 @@ add_face_info(GtkWidget *table, gint *ro
 		continue;
 
 	    switch (sname.name_id) {
+	    case TT_NAME_ID_VERSION_STRING:
+		g_free(version);
+		version = g_convert(sname.string, sname.string_len,
+				    "UTF-8", "UTF-16BE", NULL, NULL, NULL);
+		break;
 	    case TT_NAME_ID_COPYRIGHT:
 		g_free(copyright);
 		copyright = g_convert(sname.string, sname.string_len,
 				      "UTF-8", "UTF-16BE", NULL, NULL, NULL);
 		break;
-	    case TT_NAME_ID_VERSION_STRING:
-		g_free(version);
-		version = g_convert(sname.string, sname.string_len,
-				    "UTF-8", "UTF-16BE", NULL, NULL, NULL);
+	    case TT_NAME_ID_LICENSE:
+		g_free(license);
+		license = g_convert(sname.string, sname.string_len,
+					"UTF-8", "UTF-16BE", NULL, NULL, NULL);
+		break;
+	    case TT_NAME_ID_LICENSE_URL:
+		g_free(license_url);
+		license_url = g_convert(sname.string, sname.string_len,
+					"UTF-8", "UTF-16BE", NULL, NULL, NULL);
+		break;
+	    case TT_NAME_ID_DESIGNER:
+		g_free(designer);
+		designer = g_convert(sname.string, sname.string_len,
+					"UTF-8", "UTF-16BE", NULL, NULL, NULL);
+		break;
+	    case TT_NAME_ID_DESIGNER_URL:
+		g_free(designer_url);
+		designer_url = g_convert(sname.string, sname.string_len,
+					"UTF-8", "UTF-16BE", NULL, NULL, NULL);
+		break;
+	    case TT_NAME_ID_TRADEMARK:
+		g_free(trademark);
+		trademark = g_convert(sname.string, sname.string_len,
+					"UTF-8", "UTF-16BE", NULL, NULL, NULL);
 		break;
 	    case TT_NAME_ID_DESCRIPTION:
 		g_free(description);
@@ -340,9 +406,29 @@ add_face_info(GtkWidget *table, gint *ro
 	    g_free(version);
 	}
 	if (copyright) {
-	    add_row(table, row_p, _("Copyright:"), copyright, TRUE);
+	    add_row(table, row_p, _("Copyright:"), copyright, FALSE);
 	    g_free(copyright);
 	}
+	if (license) {
+	    add_row(table, row_p, _("License:"), license, TRUE);
+	    g_free(license);
+	}
+	if (license_url) {
+	    add_row_url(table, row_p, license ? "" : _("License:"), license_url, FALSE);
+	    g_free(license_url);
+	}
+	if (designer) {
+	    add_row(table, row_p, _("Designer:"), designer, FALSE);
+	    g_free(designer);
+	}
+	if (designer_url) {
+	    add_row_url(table, row_p, designer ? "" : _("Designer:"), designer_url, FALSE);
+	    g_free(designer_url);
+	}
+	if (trademark) {
+	    add_row(table, row_p, _("Trademark:"), trademark, FALSE);
+	    g_free(trademark);
+	}
 	if (description) {
 	    add_row(table, row_p, _("Description:"), description, TRUE);
 	    g_free(description);
@@ -352,6 +438,18 @@ add_face_info(GtkWidget *table, gint *ro
 	    add_row(table, row_p, _("Version:"), ps_info.version, FALSE);
 	if (ps_info.notice && g_utf8_validate(ps_info.notice, -1, NULL))
 	    add_row(table, row_p, _("Copyright:"), ps_info.notice, TRUE);
+	if (ps_info.notice && g_utf8_validate(ps_info.notice, -1, NULL))
+	    add_row(table, row_p, _("License:"), ps_info.notice, TRUE);
+	if (ps_info.notice && g_utf8_validate(ps_info.notice, -1, NULL))
+	    add_row(table, row_p, _("License URL:"), ps_info.notice, FALSE);
+	if (ps_info.notice && g_utf8_validate(ps_info.notice, -1, NULL))
+	    add_row(table, row_p, _("Designer:"), ps_info.notice, FALSE);
+	if (ps_info.notice && g_utf8_validate(ps_info.notice, -1, NULL))
+	    add_row(table, row_p, _("Designer URL:"), ps_info.notice, FALSE);
+	if (ps_info.notice && g_utf8_validate(ps_info.notice, -1, NULL))
+	    add_row(table, row_p, _("Trademark:"), ps_info.notice, FALSE);
+	if (ps_info.notice && g_utf8_validate(ps_info.notice, -1, NULL))
+	    add_row(table, row_p, _("Description:"), ps_info.notice, FALSE);
     }
 }
 
@@ -423,7 +521,7 @@ main(int argc, char **argv)
     if (error) {
 	g_printerr("could not initialise freetype\n");
 	return 1;
-    }  
+    }
 
     font_file = gnome_vfs_make_uri_from_shell_arg (argv[1]);
     if (!font_file) {
@@ -454,7 +552,7 @@ main(int argc, char **argv)
     gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, TRUE, 0);
 
     row = 0;
-    add_face_info(table, &row, font_file, face);
+    add_face_info(GTK_TABLE (table), &row, font_file, face);
 
     gtk_table_set_col_spacings(GTK_TABLE(table), 8);
     gtk_table_set_row_spacings(GTK_TABLE(table), 2);
