--- pango-1.24.5/pango/pango-context.c.orig	2009-10-26 11:51:29.000000000 +0900
+++ pango-1.24.5/pango/pango-context.c	2009-12-09 00:26:50.000000000 +0900
@@ -763,6 +763,9 @@ update_attr_iterator (ItemizeState *stat
   state->font_desc = pango_font_description_copy_static (state->context->font_desc);
   pango_attr_iterator_get_font (state->attr_iter, state->font_desc,
 				&state->lang, &state->extra_attrs);
+  family = pango_font_description_get_family (state->context->font_desc);
+  if (family)
+    pango_font_description_set_family (state->font_desc, family);
   if (pango_font_description_get_set_fields (state->font_desc) & PANGO_FONT_MASK_GRAVITY)
     state->font_desc_gravity = pango_font_description_get_gravity (state->font_desc);
   else
--- pango-1.24.5/pango/pango-coverage.c.orig	2009-12-02 19:03:19.000000000 +0900
+++ pango-1.24.5/pango/pango-coverage.c	2009-12-02 19:21:37.000000000 +0900
@@ -247,7 +247,14 @@ pango_coverage_set (PangoCoverage     *c
     }
 
   i = index % 256;
-  data[i/4] |= level << ((i % 4) * 2);
+  if (level == PANGO_COVERAGE_NONE)
+    {
+      level = PANGO_COVERAGE_EXACT;
+      if (data[i/4] & (level << ((i % 4) * 2)))
+        data[i/4] ^= level << ((i % 4) * 2);
+    }
+  else
+      data[i/4] |= level << ((i % 4) * 2);
 }
 
 /**
--- pango-1.24.5/pango/pangofc-fontmap.c.orig	2009-12-09 01:42:02.000000000 +0900
+++ pango-1.24.5/pango/pangofc-fontmap.c	2009-12-09 17:07:38.000000000 +0900
@@ -232,6 +232,8 @@ static FcPattern       *pango_fc_pattern
 static FcPattern *uniquify_pattern (PangoFcFontMap *fcfontmap,
 				    FcPattern      *pattern);
 
+static gboolean hex (const char *spec, int len, int *c);
+
 static gpointer
 get_gravity_class (void)
 {
@@ -842,6 +844,9 @@ pango_fc_fontset_load_next_font (PangoFc
 {
   FcPattern *pattern, *font_pattern;
   PangoFont *font;
+  char *font_family_str;
+  gboolean composite_font = FALSE;
+  FcCompCharSet *compcharset;
 
   pattern = pango_fc_patterns_get_pattern (fontset->patterns),
   font_pattern = pango_fc_patterns_get_font_pattern (fontset->patterns,
@@ -865,6 +870,32 @@ pango_fc_fontset_load_next_font (PangoFc
 				     fontset->key,
 				     font_pattern);
 
+  font_family_str = pango_font_description_to_string (fontset->key->desc);
+  if (font_family_str)
+    {
+      if (!strncasecmp (font_family_str, "monospace", strlen ("monospace")))
+        composite_font = TRUE;
+      if (!strncasecmp (font_family_str, "sans", strlen ("sans")))
+        composite_font = TRUE;
+      if (!strncasecmp (font_family_str, "serif", strlen ("serif")))
+        composite_font = TRUE;
+    }
+
+  if (composite_font)
+    {
+      if (FcPatternGetCompCharSet (font_pattern, "compcharset", 0, &compcharset) == FcResultMatch)
+        {
+          if (compcharset &&
+              compcharset->lang &&
+              compcharset->mode != 0 &&
+              compcharset->range &&
+              fontset->key->language &&
+              !strncasecmp ((char *) fontset->key->language, (char *) compcharset->lang, 2))
+            g_object_set_data (G_OBJECT (font), "composite_font",
+                               (gpointer) TRUE);
+        }
+    }
+
   FcPatternDestroy (font_pattern);
 
   return font;
@@ -1723,6 +1754,42 @@ pango_fc_fontset_cache (PangoFcFontset *
   g_queue_push_head_link (cache, fontset->cache_link);
 }
 
+static gboolean
+pango_fc_font_is_strong (PangoFontMap                 *fontmap,
+			 PangoContext                 *context,
+			 const PangoFontDescription   *desc,
+			 PangoLanguage                *language)
+{
+  PangoFontset *lang_fontset;
+  PangoFcFont *fcfont = NULL;
+  gboolean composite_font;
+  FcCompCharSet *compcharset;
+  char *range;
+
+  lang_fontset = pango_fc_font_map_load_fontset (fontmap, context,
+                                                 desc, language);
+  pango_fontset_foreach (lang_fontset, get_first_font, &fcfont);
+  if (fcfont)
+    {
+      composite_font = (gboolean) g_object_get_data (G_OBJECT (fcfont), "composite_font");
+      if (FcPatternGetCompCharSet (fcfont->font_pattern, "compcharset", 0, &compcharset) != FcResultMatch)
+	return FALSE;
+      else if (compcharset == NULL)
+	return FALSE;
+      else if (compcharset->lang == NULL || compcharset->mode == 0 ||
+               compcharset->range == NULL)
+	return FALSE;
+
+      range = g_strstrip ((gchar *) compcharset->range);
+      if (compcharset->mode == 2 &&
+	  pango_language_matches (language, (gchar *) compcharset->lang) &&
+	  !g_strcmp0 (range, "all"))
+	return TRUE;
+    }
+
+  return FALSE;
+}
+
 static PangoFontset *
 pango_fc_font_map_load_fontset (PangoFontMap                 *fontmap,
 				PangoContext                 *context,
@@ -1731,9 +1798,20 @@ pango_fc_font_map_load_fontset (PangoFon
 {
   PangoFcFontMap *fcfontmap = (PangoFcFontMap *)fontmap;
   PangoFcFontMapPrivate *priv = fcfontmap->priv;
+  PangoLanguage *default_language;
   PangoFcFontset *fontset;
   PangoFcFontsetKey key;
 
+  default_language = pango_language_get_default ();
+  if (pango_language_matches (default_language, "en") != TRUE &&
+      pango_language_matches (language, "en") == TRUE)
+    {
+      if (pango_fc_font_is_strong (fontmap, context, desc, default_language))
+        {
+          language = default_language;
+        }
+    }
+
   pango_fc_fontset_key_init (&key, fcfontmap, context, desc, language);
 
   fontset = g_hash_table_lookup (priv->fontset_hash, &key);
@@ -1860,6 +1938,110 @@ _pango_fc_font_map_get_cmap_cache (Pango
   return _pango_fc_cmap_cache_ref (data->cmap_cache);
 }
 
+static gboolean
+hex (const char *spec,
+    int len,
+    int *c)
+{
+  const char *end;
+  *c = 0;
+  for (end = spec + len; spec != end; spec++)
+    if (g_ascii_isxdigit (*spec))
+      *c = (*c << 4) | g_ascii_xdigit_value (*spec);
+    else
+      return FALSE;
+  return TRUE;
+}
+
+static void
+pang_fc_font_set_coverage_from_comcharset (PangoFcFont          *fcfont,
+					   PangoFcFontFaceData  *data)
+{
+  gboolean composite_font;
+  FcCompCharSet *compcharset;
+  gchar *range_orig, *range_head, *range_tail, *range_hyphen;
+  int i, len, first, end;
+  PangoCoverageLevel level = PANGO_COVERAGE_NONE;
+
+  composite_font = (gboolean) g_object_get_data (G_OBJECT (fcfont), "composite_font");
+  if (composite_font == FALSE || G_UNLIKELY (data->coverage == NULL))
+    return;
+
+  if (FcPatternGetCompCharSet (fcfont->font_pattern, "compcharset", 0, &compcharset) != FcResultMatch)
+    return;
+
+  if (compcharset == NULL)
+    return;
+  if (compcharset->lang == NULL || compcharset->mode == 0 ||
+      compcharset->range == NULL)
+    return;
+
+  if (compcharset->mode == 1)
+    level = PANGO_COVERAGE_NONE;
+  else if (compcharset->mode == 2)
+    level = PANGO_COVERAGE_EXACT;
+  else
+    {
+      g_warning ("Error detecting mode in compcharset: lang %s mode %d range %s",
+                 compcharset->lang, compcharset->mode, compcharset->range);
+      level = PANGO_COVERAGE_NONE;
+    }
+
+  range_orig = range_head = g_strdup ((gchar *) compcharset->range);
+
+  while (range_head && *range_head == ' ')
+    range_head++;
+  while (range_head)
+    {
+      range_tail = index (range_head, ',');
+      if (range_tail)
+	*(range_tail)++ = '\0';
+
+      range_hyphen = index (range_head, '-');
+      if (range_hyphen)
+	*(range_hyphen)++ = '\0';
+
+      len = strlen (range_head);
+      if (len > 2 && !strncasecmp (range_head, "0x", 2))
+	{
+	  hex (range_head + 2, len - 2, &first);
+        }
+      else if (!strncasecmp (range_head, "all", 4))
+	{
+	  g_free (range_orig);
+	  return;
+	}
+      else
+	{
+	  first = atoi (range_head);
+	}
+
+      if (range_hyphen)
+	{
+	  len = strlen (range_hyphen);
+	  if (len > 2 && !strncasecmp (range_hyphen, "0x", 2))
+	    hex (range_hyphen + 2, len - 2, &end);
+	  else
+	    end = atoi (range_hyphen);
+	}
+      else
+	end = first;
+
+      for (i = first; i <= end; i ++)
+	{
+	  pango_coverage_set (data->coverage, i, level);
+	}
+
+      range_head = range_tail;
+
+      while (range_head && *range_head == ' ')
+	range_head++;
+    }
+
+  g_free (range_orig);
+  return;
+}
+
 PangoCoverage *
 _pango_fc_font_map_get_coverage (PangoFcFontMap *fcfontmap,
 				 PangoFcFont    *fcfont)
@@ -1884,6 +2066,8 @@ _pango_fc_font_map_get_coverage (PangoFc
 	return NULL;
 
       data->coverage = _pango_fc_font_map_fc_to_coverage (charset);
+
+      pang_fc_font_set_coverage_from_comcharset (fcfont, data);
     }
 
   return pango_coverage_ref (data->coverage);
