changeset 15444:154b8d8643a2

GNOME has a 'document font' setting that we should use when running on GNOME. This does the gconftool-2 spawning trick to get it
author Sean Egan <seanegan@gmail.com>
date Sun, 28 Jan 2007 21:40:07 +0000
parents 8721df7d419f
children c68f2808f703
files pidgin/gtkutils.c
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkutils.c	Sun Jan 28 09:02:20 2007 +0000
+++ b/pidgin/gtkutils.c	Sun Jan 28 21:40:07 2007 +0000
@@ -98,6 +98,27 @@
 	gaim_gtkthemes_smiley_themeize(imhtml);
 
 	gtk_imhtml_set_funcs(GTK_IMHTML(imhtml), &gtkimhtml_cbs);
+
+	/* Use the GNOME "document" font, if applicable */
+	if (gaim_running_gnome()) {
+		char *path, *font;
+		PangoFontDescription *desc = NULL;
+				
+		if ((path = g_find_program_in_path("gconftool-2"))) {
+			g_free(path);
+			if (!g_spawn_command_line_sync(
+					"gconftool-2 -g /desktop/gnome/interface/document_font_name", 
+					&font, NULL, NULL, NULL))
+				return;
+		}
+		desc = pango_font_description_from_string(font);
+		g_free(font);
+		
+		if (desc) {
+			gtk_widget_modify_font(imhtml, desc);
+			pango_font_description_free(desc);
+		}
+	}
 }
 
 GtkWidget *