? pango-caching-2.patch
? pangodiff
? pangofc-fontmap.ssp.cI
Index: pangofc-fontmap.cI
===================================================================
RCS file: /cvs/gnome/pango/pango/pangofc-fontmap.cI,v
retrieving revision 1.6
diff -u -p -u -r1.6 pangofc-fontmap.cI
--- pangofc-fontmap.cI	17 Dec 2002 02:07:36 -0000	1.6
+++ pangofc-fontmap.cI	27 Jan 2003 01:53:19 -0000
@@ -302,6 +302,9 @@ pango_fc_font_map_finalize (GObject *obj
   pango_fc_clear_fontset_hash_list (fcfontmap);
   g_hash_table_destroy (fcfontmap->coverage_hash);
 
+  if (fcfontmap->fontsets)
+    g_hash_table_destroy (fcfontmap->fonts);
+  
   if (fcfontmap->fonts)
     g_hash_table_destroy (fcfontmap->fonts);
 
@@ -664,12 +667,23 @@ pango_fc_font_map_load_fontset (PangoFon
 				 const PangoFontDescription   *desc,
 				 PangoLanguage                *language)
 {
+  PangoFcFontMap *fcfontmap = (PangoFcFontMap *)fontmap;
   PangoFontsetSimple *simple;
   int i;
   PangoFcPatternSet *patterns = pango_fc_font_map_get_patterns (fontmap, context, desc, language);
   if (!patterns)
     return NULL;
-	  
+
+  if (!fcfontmap->fontsets)
+    {
+      fcfontmap->fontsets = g_hash_table_new_full (g_direct_hash, g_direct_equal,
+						   NULL, (GDestroyNotify)g_object_unref);
+    }
+
+  simple = g_hash_table_lookup (fcfontmap->fontsets, patterns);
+  if (simple)
+    return g_object_ref (G_OBJECT (simple));
+
   simple = pango_fontset_simple_new (language);
 
   for (i = 0; i < patterns->n_patterns; i++)
@@ -678,6 +692,8 @@ pango_fc_font_map_load_fontset (PangoFon
       if (font)
 	pango_fontset_simple_append (simple, font);
     }
+
+  g_hash_table_insert (fcfontmap->fontsets, patterns, g_object_ref (simple));
   
   return PANGO_FONTSET (simple);
 }
Index: pangoft2-fontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangoft2-fontmap.c,v
retrieving revision 1.44
diff -u -p -u -r1.44 pangoft2-fontmap.c
--- pangoft2-fontmap.c	3 Dec 2002 06:43:10 -0000	1.44
+++ pangoft2-fontmap.c	27 Jan 2003 01:53:19 -0000
@@ -60,6 +60,7 @@ struct _PangoFT2FontMap
    */
   GHashTable *pattern_hash; 
   GHashTable *coverage_hash; /* Maps font file name -> PangoCoverage */
+  GHashTable *fontsets; /* Maps PangoFcPatternSet -> PangoFontSet */
 
   GHashTable *fonts; /* Maps XftPattern -> PangoFT2Font */
   GQueue *freed_fonts; /* Fonts in fonts that has been freed */
Index: pangoxft-fontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangoxft-fontmap.c,v
retrieving revision 1.38
diff -u -p -u -r1.38 pangoxft-fontmap.c
--- pangoxft-fontmap.c	7 Dec 2002 06:08:39 -0000	1.38
+++ pangoxft-fontmap.c	27 Jan 2003 01:53:20 -0000
@@ -50,6 +50,7 @@ struct _PangoXftFontMap
    */
   GHashTable *pattern_hash; 
   GHashTable *coverage_hash; /* Maps font file name/id -> PangoCoverage */
+  GHashTable *fontsets; /* Maps PangoFcPatternSet -> PangoFontSet */
 
   GHashTable *fonts; /* Maps XftPattern -> PangoXftFont */
   GQueue *freed_fonts; /* Fonts in fonts that has been freed */
