? pango_disable_fallback.diff
Index: pango/pango-context.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-context.c,v
retrieving revision 1.49
diff -u -r1.49 pango-context.c
--- pango/pango-context.c	14 Oct 2002 22:50:47 -0000	1.49
+++ pango/pango-context.c	8 Feb 2003 02:47:49 -0000
@@ -36,6 +36,8 @@
   PangoFontDescription *font_desc;
 
   PangoFontMap *font_map;
+
+  gboolean enable_fallback;
 };
 
 struct _PangoContextClass
@@ -93,6 +95,7 @@
   context->base_dir = PANGO_DIRECTION_LTR;
   context->language = NULL;
   context->font_map = NULL;
+  context->enable_fallback = TRUE;
 
   context->font_desc = pango_font_description_new ();
   pango_font_description_set_family (context->font_desc, "serif");
@@ -741,3 +744,28 @@
 
   return metrics;
 }
+
+/*
+ * pango_context_get_enable_fallback:
+ * @context: a #PangoContext
+ *
+ * Returns: TRUE if fallback is enabled, FALSE otherwise.
+ */
+gboolean
+pango_context_get_enable_fallback (PangoContext *context)
+{
+  return context->enable_fallback;
+}
+
+/*
+ * pango_context_set_enable_fallback:
+ * @context: a #PangoContext
+ * @enable_fallback: whether to enable fallback
+ */
+void
+pango_context_set_enable_fallback (PangoContext *context, 
+                                   gboolean      enable_fallback)
+{
+  context->enable_fallback = enable_fallback;
+}
+
Index: pango/pango-context.h
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-context.h,v
retrieving revision 1.16
diff -u -r1.16 pango-context.h
--- pango/pango-context.h	18 Nov 2001 23:23:14 -0000	1.16
+++ pango/pango-context.h	8 Feb 2003 02:47:49 -0000
@@ -77,6 +77,9 @@
 void                      pango_context_set_base_dir         (PangoContext               *context,
 							      PangoDirection              direction);
 PangoDirection            pango_context_get_base_dir         (PangoContext               *context);
+gboolean                  pango_context_get_enable_fallback  (PangoContext               *context);
+void                      pango_context_set_enable_fallback  (PangoContext               *context, 
+                                                              gboolean                    enable_fallback);
 
 /* Break a string of Unicode characters into segments with
  * consistent shaping/language engine and bidrectional level.
Index: pango/pangofc-fontmap.cI
===================================================================
RCS file: /cvs/gnome/pango/pango/pangofc-fontmap.cI,v
retrieving revision 1.6
diff -u -r1.6 pangofc-fontmap.cI
--- pango/pangofc-fontmap.cI	17 Dec 2002 02:07:36 -0000	1.6
+++ pango/pangofc-fontmap.cI	8 Feb 2003 02:47:49 -0000
@@ -665,14 +665,19 @@
 				 PangoLanguage                *language)
 {
   PangoFontsetSimple *simple;
-  int i;
+  int i, n;
   PangoFcPatternSet *patterns = pango_fc_font_map_get_patterns (fontmap, context, desc, language);
   if (!patterns)
     return NULL;
 	  
   simple = pango_fontset_simple_new (language);
 
-  for (i = 0; i < patterns->n_patterns; i++)
+  if (pango_context_get_enable_fallback (context))
+    n = patterns->n_patterns;
+  else
+    n = 1;  /* if fallback is disabled, just use the first font */
+
+  for (i = 0; i < n; i++)
     {
       PangoFont *font = pango_fc_font_map_new_font (fontmap, patterns->patterns[i]);
       if (font)
