Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.1579.2.5
diff -u -p -r1.1579.2.5 ChangeLog
--- ChangeLog	24 Mar 2003 15:22:07 -0000	1.1579.2.5
+++ ChangeLog	24 Mar 2003 19:16:02 -0000
@@ -1,3 +1,10 @@
+2003-03-24  Larry Ewing  <lewing@ximian.com>
+
+	* htmlgdkpainter.c (load_font_with_name): try loading font as
+	fontset first and check for a valid and unique fontlist.  Based
+	very heavily on a patch by suresh.chandrasekharan@sun.com (Suresh)
+	addresses bug #30870
+	
 2003-03-23  Larry Ewing  <lewing@ximian.com>
 
 	* htmlengine.c (remove_font_style): always make sure that if there
Index: htmlgdkpainter.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlgdkpainter.c,v
retrieving revision 1.95
diff -u -p -r1.95 htmlgdkpainter.c
--- htmlgdkpainter.c	28 Oct 2002 16:24:02 -0000	1.95
+++ htmlgdkpainter.c	24 Mar 2003 19:16:02 -0000
@@ -270,20 +270,37 @@ static gpointer
 load_font_with_name (gchar *name)
 {
 	GdkFont *gdk_font;
-	gboolean need_fontset = FALSE;
 	gpointer font;
 	GTimer *timer;
 	gdouble elapsed;
 
-	if (strchr (name, ','))
-		need_fontset = TRUE;
-
 	timer = g_timer_new ();
 	g_timer_start (timer);
-	gdk_font = need_fontset ? gdk_fontset_load (name) : gdk_font_load (name);
+
+	gdk_font = gdk_fontset_load (name);
+	if (gdk_font) {
+		XFontStruct **fstruct_list;
+		gchar **fname_list;
+		gint i=0, j, k=0;
+
+		k = i = XFontsOfFontSet (GDK_FONT_XFONT (gdk_font), &fstruct_list, &fname_list);
+		/*
+		 * Check to account for the number of duplicate 
+		 * fonts in fname_list
+		 */
+		for(j=1; j<i; j++)
+			if(!strcmp(*(fname_list+j-1),*(fname_list+j)))
+				k--;
+
+		if (k < 2) {
+			gdk_font_unref (gdk_font);
+			gdk_font = gdk_font_load (name);
+		} 
+	}
 	elapsed = g_timer_elapsed (timer, NULL);
 	g_timer_destroy (timer);
-	printf ("(%1.4fs) [load] %s --> %p\n", elapsed, name, gdk_font);
+	printf ("(%1.4fs) [load] %s --> %p as %s\n", elapsed, name, gdk_font, 
+		(gdk_font && gdk_font->type == GDK_FONT_FONTSET) ? "fontset":"font");
 
 	if (gdk_font) {
 		font = e_font_from_gdk_font_gtkhtml (gdk_font);
