Index: modules.c
===================================================================
RCS file: /cvs/gnome/pango/pango/modules.c,v
retrieving revision 1.47
diff -u -w -r1.47 modules.c
--- modules.c	12 Nov 2003 08:42:43 -0000	1.47
+++ modules.c	28 Feb 2004 17:21:50 -0000
@@ -633,6 +633,10 @@
 {
   PangoMapEntry *entry = NULL;
   PangoMapEntry *common_entry = NULL;
+  PangoMapEntry *preferred_entry = NULL;
+  
+  if (map->entries->len)
+    g_warning("got pango_map_engine is actually used");
   
   if (script < map->entries->len)
     entry = &g_array_index (map->entries, PangoMapEntry, script);
@@ -640,7 +644,12 @@
   if (PANGO_SCRIPT_COMMON < map->entries->len)
     common_entry = &g_array_index (map->entries, PangoMapEntry, PANGO_SCRIPT_COMMON);
 
-  if (entry && entry->exact)
+  if (PANGO_SCRIPT_PREFERRED < map->entries->len)
+    preferred_entry = &g_array_index (map->entries, PangoMapEntry, PANGO_SCRIPT_PREFERRED);
+
+  if (preferred_entry && preferred_entry->exact)
+    return pango_engine_pair_get_engine (preferred_entry->exact->data);
+  else if (entry && entry->exact)
     return pango_engine_pair_get_engine (entry->exact->data);
   else if (common_entry && common_entry->exact)
     return pango_engine_pair_get_engine (common_entry->exact->data);
@@ -690,16 +699,23 @@
 {
   PangoMapEntry *entry = NULL;
   PangoMapEntry *common_entry = NULL;
+  PangoMapEntry *preferred_entry = NULL;
   
+  g_message("pango_map_get_engines");
   if (script < map->entries->len)
     entry = &g_array_index (map->entries, PangoMapEntry, script);
 
   if (PANGO_SCRIPT_COMMON < map->entries->len)
     common_entry = &g_array_index (map->entries, PangoMapEntry, PANGO_SCRIPT_COMMON);
 
+  if (PANGO_SCRIPT_PREFERRED < map->entries->len)
+    preferred_entry = &g_array_index (map->entries, PangoMapEntry, PANGO_SCRIPT_PREFERRED);
+
   if (exact_engines)
     {
       *exact_engines = NULL;
+      if (preferred_entry && preferred_entry->exact)
+	append_engines (exact_engines, preferred_entry->exact);
       if (entry && entry->exact)
 	append_engines (exact_engines, entry->exact);
       else if (common_entry && common_entry->exact)
