--- htmlgdkpainter.c.orig	2003-02-12 16:12:43.993026000 -0800
+++ htmlgdkpainter.c	2003-02-13 19:15:37.119238000 -0800
@@ -270,17 +270,33 @@
 load_font_with_name (gchar *name)
 {
 	GdkFont *gdk_font;
-	gboolean need_fontset = FALSE;
 	gpointer font;
 	GTimer *timer;
+	gchar *defonts, **missingfonts, **fname_list;
+	gint count, i=0, j, k=0;
 	gdouble elapsed;
-
-	if (strchr (name, ','))
-		need_fontset = TRUE;
+	XFontSet fset;
+	XFontStruct  **fstruct_list;
 
 	timer = g_timer_new ();
 	g_timer_start (timer);
-	gdk_font = need_fontset ? gdk_fontset_load (name) : gdk_font_load (name);
+
+	if ((fset = XCreateFontSet(gdk_display, name, &missingfonts, &count, &defonts)) != NULL) {
+		k = i = XFontsOfFontSet (fset, &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--;
+		XFreeFontSet(gdk_display, fset);
+	}
+
+	gdk_font = (k>1) ? gdk_fontset_load (name) : 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);
