Index: pango/pangowin32-fontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangowin32-fontmap.c,v
retrieving revision 1.51
diff -p -u -2 -r1.51 pangowin32-fontmap.c
--- pango/pangowin32-fontmap.c	28 Apr 2005 17:20:05 -0000	1.51
+++ pango/pangowin32-fontmap.c	18 Jul 2005 10:52:25 -0000
@@ -48,4 +48,5 @@ struct _PangoWin32Family
 
   gboolean is_monospace;
+  BYTE pitch_and_family;
 };
 
@@ -77,4 +78,8 @@ static void       pango_win32_font_map_l
 						       PangoFontFamily            ***families,
 						       int                          *n_families);
+static PangoFontset *pango_win32_font_map_load_fontset (PangoFontMap               *fontmap,
+							PangoContext               *context,
+							const PangoFontDescription *desc,
+							PangoLanguage              *language);
   
 static PangoFont *pango_win32_font_map_real_find_font (PangoWin32FontMap          *win32fontmap,
@@ -190,4 +195,5 @@ pango_win32_font_map_class_init (PangoWi
   fontmap_class->load_font = pango_win32_font_map_load_font;
   fontmap_class->list_families = pango_win32_font_map_list_families;
+  fontmap_class->load_fontset = pango_win32_font_map_load_fontset;
   fontmap_class->shape_engine_type = PANGO_RENDER_TYPE_WIN32;
   
@@ -372,4 +378,46 @@ pango_win32_font_map_list_families (Pang
 }
 
+static PangoFontset *
+pango_win32_font_map_load_fontset (PangoFontMap               *fontmap,
+				   PangoContext               *context,
+				   const PangoFontDescription *desc,
+				   PangoLanguage              *language)
+{
+  const gchar *family = pango_font_description_get_family (desc);
+
+  if (strchr (family, ',') == NULL)
+    {
+      PangoWin32FontMap *win32fontmap = (PangoWin32FontMap *) fontmap;
+      PangoWin32Family *win32_family = g_hash_table_lookup (win32fontmap->families, family);
+
+      if (win32_family != NULL)
+	{
+	  PangoFontset *retval;
+	  PangoFontDescription *amended_desc = pango_font_description_copy_static (desc);
+	  char *amended_family;
+	  
+	  if ((win32_family->pitch_and_family & 0xF0) == FF_ROMAN)
+	    amended_family = g_strconcat (family, ",serif", NULL);
+	  else if ((win32_family->pitch_and_family & 0xF0) == FF_MODERN)
+	    amended_family = g_strconcat (family, ",monospace", NULL);
+	  else
+	    amended_family = g_strconcat (family, ",sans", NULL);
+	  
+	  pango_font_description_set_family_static (amended_desc, amended_family);
+	  
+	  retval = PANGO_FONT_MAP_CLASS (pango_win32_font_map_parent_class)->load_fontset (fontmap, context,
+										       amended_desc, language);
+
+	  pango_font_description_free (amended_desc);
+	  g_free (amended_family);
+
+	  return retval;
+	}
+    }
+
+  return PANGO_FONT_MAP_CLASS (pango_win32_font_map_parent_class)->load_fontset
+    (fontmap, context, desc, language);
+}
+
 static PangoWin32Family *
 pango_win32_get_font_family (PangoWin32FontMap *win32fontmap,
@@ -726,4 +774,11 @@ pango_win32_insert_font (PangoWin32FontM
   g_free (family_name);
 
+  if (font_family->font_entries == NULL)
+    {
+      font_family->pitch_and_family = lfp->lfPitchAndFamily;
+      if ((font_family->pitch_and_family & 0xF0) == FF_MODERN)
+	font_family->is_monospace = TRUE;
+    }
+
   tmp_list = font_family->font_entries;
   while (tmp_list)
