diff -urN dia-0.90.RC1/lib/font.c dia/lib/font.c
--- dia-0.90.RC1/lib/font.c	Wed May  8 06:22:59 2002
+++ dia/lib/font.c	Tue May 21 18:36:47 2002
@@ -62,6 +62,7 @@
 #include "gdk/gdkx.h"
 #include <sys/types.h>
 #include <dirent.h>
+#include <glib.h>
 #endif
 
 #include "utils.h"
@@ -475,6 +478,21 @@
 };
 #define NUM_LAST_RESORT_FONTS (sizeof(last_resort_fonts)/sizeof(char *))
 
+char *xfs_configs[]={
+  "/etc/X11/fs/config",		/* RedHat */
+  "/etc/X11/xfs/config",	/* Debian */
+};
+#define NUM_XFS_CONFIGS (sizeof(xfs_configs)/sizeof(char *))
+
+char *default_font_paths[]={
+  "/usr/X11R6/lib/X11/fonts",	/* The usual */
+  "/usr/share/fonts/default",	/* another */
+  "/usr/share/fonts/truetype"	/* XFSTT only looks here */
+};
+#define NUM_DEFAULT_FONT_PATHS ((sizeof(default_font_paths)/sizeof(*char))
+
+
+
 static void
 init_x11_font(FontPrivate *font)
 {
@@ -578,7 +596,10 @@
       g_free(fullname);
       return;
     }
-    
+   
+    if (face->family_name == NULL)
+       return;
+
     new_font = (FreetypeFamily*)g_hash_table_lookup(freetype_fonts, face->family_name);
     if (new_font == NULL) {
       new_font = (FreetypeFamily*)g_malloc(sizeof(FreetypeFamily));
@@ -630,12 +651,66 @@
   closedir(fontdir);
 }
 
+static GPtrArray *
+freetype_scan_fontserver(char *config)
+  /* Scans xfs configuration file passed in config for font paths
+   * Returns a GPtrArray of strings which are possible font paths
+   * Array should be freed once no longer required
+   * The file config does not have to exist. */
+{
+  char line[FILENAME_MAX];	/* FILENAME_MAX is defined in stdio.h in gcc - others?? */
+  FILE *file;
+  GPtrArray *fontlist;
+
+  file=fopen(config,"r");
+  if (file == NULL)
+  {
+    return(NULL);
+  }
+
+  fontlist = g_ptr_array_new();
+  
+  while (!feof(file))
+  {
+    gchar *newpath;
+
+    if (fgets(line, sizeof(line), file) == NULL)	/* get line from file */
+      break;
+
+
+    g_strstrip(line);	/* Remove leading and trailing white space */
+    
+    if (*line == '/')	/* Skip all bug_ptr_array_index(flist, i)t paths */
+    {
+
+    /* If the line now starts with a / we can try it as a path 
+     * Add it to the font list. 
+     * Note that both the array and strings need to be freed later */
+
+      newpath = g_strdup(line);
+      g_ptr_array_add(fontlist, (gpointer) newpath);
+    }
+
+  }
+
+
+  fclose(file);
+
+  return(fontlist);
+}
+
+  
+
+  
 void
 font_init_freetype()
 {
   char **fontlist;
   int fontcount;
-  int i;
+  int i,config;
+  int xfontserver;
+  GPtrArray *flist;
+  
   FT_Error error = FT_Init_FreeType( &ft_library );
   if ( error )
   {
@@ -652,10 +727,32 @@
     return;
   }
 
+  xfontserver=FALSE;
+
   for (i = 0; i < fontcount; i++) {
+    if (fontlist[i][0]!='/')
+      xfontserver=TRUE;
     freetype_scan_directory(fontlist[i]);
   }
 
+  if (xfontserver)
+  {
+    for (config=0; config< NUM_XFS_CONFIGS; config++)
+    {
+      flist = freetype_scan_fontserver(xfs_configs[config]);
+
+      if (flist == NULL)
+	continue;
+
+      for (i=0; i < flist->len; i++)
+      {
+	freetype_scan_directory((char *)g_ptr_array_index(flist, i));
+      }
+
+      g_ptr_array_free(flist, TRUE);	/* Free the list and its members */
+    }
+  }
+
   if (g_hash_table_size(freetype_fonts) == 0) {
     message_warning(_("Warning: No fonts loaded.  Are there any font files in the X font path?"));
   }

