diff -r -u ../pango-1.28.0.orig/modules/basic/basic-win32.c ../pango-1.28.0.uniscribe_patch/modules/basic/basic-win32.c
--- ../pango-1.28.0.orig/modules/basic/basic-win32.c	2010-03-30 21:11:37 +0200
+++ ../pango-1.28.0.uniscribe_patch/modules/basic/basic-win32.c	2010-04-18 17:34:09 +0200
@@ -489,14 +489,15 @@
   g_free (byte_offset);
 }
 
+extern HFONT pango_win32_peek_hfont (PangoFont *font);
+
 static gboolean
 itemize_shape_and_place (PangoFont           *font,
 			 HDC                  hdc,
 			 wchar_t             *wtext,
 			 int                  wlen,
 			 const PangoAnalysis *analysis,
-			 PangoGlyphString    *glyphs,
-			 SCRIPT_CACHE        *script_cache)
+			 PangoGlyphString    *glyphs)
 {
   int i;
   int item, nitems, item_step;
@@ -505,7 +506,13 @@
   SCRIPT_STATE state;
   SCRIPT_ITEM items[100];
   double scale = pango_win32_font_get_metrics_factor (font);
-
+  HFONT hfont = pango_win32_peek_hfont(font);
+  
+  static GHashTable *font_to_cache_table = 0;
+  if (!font_to_cache_table) {
+    font_to_cache_table = g_hash_table_new(g_int64_hash, g_int64_equal);
+  }
+  
   memset (&control, 0, sizeof (control));
   memset (&state, 0, sizeof (state));
 
@@ -551,7 +558,7 @@
       int advances[1000];
       GOFFSET offsets[1000];
       ABC abc;
-      int script = items[item].a.eScript;
+      gint32 script = items[item].a.eScript;
       int ng;
       int char_offset;
 
@@ -579,9 +586,27 @@
 		 items[item].a.fNoGlyphIndex ? " fNoGlyphIndex" : "",
 		 items[item].iCharPos, items[item+1].iCharPos-1, itemlen);
 #endif
+      /* create a hash key based on hfont and script engine */
+      gint64 font_and_script_key;
+      font_and_script_key = (((gint64) ((gint32) hfont)) << 32) | script;
+      /* get the script cache for this hfont and script */
+      SCRIPT_CACHE *script_cache;
+      script_cache = g_hash_table_lookup(font_to_cache_table, &font_and_script_key);
+      if(!script_cache) {
+        gint64 *key_n;
+        key_n = g_malloc(sizeof(gint64));
+        *key_n = font_and_script_key;
+        
+        SCRIPT_CACHE *new_script_cache = g_malloc(sizeof(SCRIPT_CACHE));
+        memset (new_script_cache, 0, sizeof(SCRIPT_CACHE));
+        script_cache = new_script_cache;
+        /* insert the new value */
+        g_hash_table_insert(font_to_cache_table, key_n, new_script_cache);
+      }
+
 
       items[item].a.fRTL = analysis->level % 2;
-      if ((*script_shape) (hdc, &script_cache[script],
+      if ((*script_shape) (hdc, script_cache,
 			   wtext + items[item].iCharPos, itemlen,
 			   G_N_ELEMENTS (iglyphs),
 			   &items[item].a,
@@ -611,7 +636,7 @@
 				 nglyphs, glyphs->log_clusters + ng,
 				 char_offset);
 
-      if ((*script_place) (hdc, &script_cache[script], iglyphs, nglyphs,
+      if ((*script_place) (hdc, script_cache, iglyphs, nglyphs,
 			   visattrs, &items[item].a,
 			   advances, offsets, &abc))
 	{
@@ -671,9 +696,7 @@
 {
   wchar_t *wtext;
   long wlen;
-  int i;
   gboolean retval = TRUE;
-  SCRIPT_CACHE script_cache[100];
 
   if (!pango_win32_font_select_font (font, hdc))
     return FALSE;
@@ -684,11 +707,7 @@
 
   if (retval)
     {
-      memset (script_cache, 0, sizeof (script_cache));
-      retval = itemize_shape_and_place (font, hdc, wtext, wlen, analysis, glyphs, script_cache);
-      for (i = 0; i < G_N_ELEMENTS (script_cache); i++)
-	if (script_cache[i])
-	  (*script_free_cache)(&script_cache[i]);
+      retval = itemize_shape_and_place (font, hdc, wtext, wlen, analysis, glyphs);
     }
 
   if (retval)
diff -r -u ../pango-1.28.0.orig/pango/pangowin32.c ../pango-1.28.0.uniscribe_patch/pango/pangowin32.c
--- ../pango-1.28.0.orig/pango/pangowin32.c	2009-11-23 07:25:41 +0100
+++ ../pango-1.28.0.uniscribe_patch/pango/pangowin32.c	2010-04-18 17:08:17 +0200
@@ -82,6 +82,23 @@
 								 PangoAttrColor   *bg_color,
 								 gboolean         *bg_set);
 
+HFONT
+pango_win32_peek_hfont (PangoFont *font)
+{
+  PangoWin32Font *win32font = (PangoWin32Font *)font;
+  PangoWin32FontCache *cache;
+
+  if (!win32font)
+    return NULL;
+  if (!win32font->hfont)
+    {
+      cache = pango_win32_font_map_get_font_cache (win32font->fontmap);
+
+      win32font->hfont = pango_win32_font_cache_loadw (cache, &win32font->logfontw);
+    }
+  return win32font->hfont;
+}
+
 static HFONT
 pango_win32_get_hfont (PangoFont *font)
 {
