Index: pango/glyphstring.c
===================================================================
RCS file: /cvs/gnome/pango/pango/glyphstring.c,v
retrieving revision 1.18
diff -p -u -2 -r1.18 glyphstring.c
--- pango/glyphstring.c	24 Jul 2003 19:04:47 -0000	1.18
+++ pango/glyphstring.c	21 Dec 2004 23:12:48 -0000
@@ -183,7 +183,21 @@ pango_glyph_string_extents_range (PangoG
       PangoGlyphGeometry *geometry = &glyphs->glyphs[i].geometry;
 
-      pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph,
-				    ink_rect ? &glyph_ink : NULL,
-				    logical_rect ? &glyph_logical : NULL);
+      if (font)
+	pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph,
+				      ink_rect ? &glyph_ink : NULL,
+				      logical_rect ? &glyph_logical : NULL);
+      else
+	{
+	  if (ink_rect)
+	    {
+	      glyph_ink.x = glyph_ink.y = 0;
+	      glyph_ink.width = glyph_ink.height = 0;
+	    }
+	  if (logical_rect)
+	    {
+	      glyph_logical.x = glyph_logical.y = 0;
+	      glyph_logical.width = glyph_logical.height = 0;
+	    }
+	}
 
       if (ink_rect && glyph_ink.width != 0 && glyph_ink.height != 0)
Index: pango/pango-context.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-context.c,v
retrieving revision 1.74
diff -p -u -2 -r1.74 pango-context.c
--- pango/pango-context.c	21 Nov 2004 15:59:15 -0000	1.74
+++ pango/pango-context.c	21 Dec 2004 23:12:49 -0000
@@ -784,5 +784,7 @@ itemize_state_fill_shaper (ItemizeState 
       if (item->analysis.shape_engine)
 	break;
-      item->analysis.font = g_object_ref (font);
+      if (font)
+	g_object_ref (font);
+      item->analysis.font = font;
       item->analysis.shape_engine = shape_engine;
     }
@@ -1308,4 +1310,7 @@ update_metrics_from_items (PangoFontMetr
       PangoFont *font = item->analysis.font;
 
+      if (!font)
+	continue;
+
       if (g_hash_table_lookup (fonts_seen, font) == NULL)
 	{
@@ -1334,6 +1339,9 @@ update_metrics_from_items (PangoFontMetr
   g_hash_table_destroy (fonts_seen);
   
-  metrics->approximate_char_width /= count;
-  metrics->approximate_digit_width /= count;
+  if (count)
+    {
+      metrics->approximate_char_width /= count;
+      metrics->approximate_digit_width /= count;
+    }
 }
 
Index: pango/pango-renderer.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-renderer.c,v
retrieving revision 1.6
diff -p -u -2 -r1.6 pango-renderer.c
--- pango/pango-renderer.c	30 Nov 2004 18:36:38 -0000	1.6
+++ pango/pango-renderer.c	21 Dec 2004 23:12:52 -0000
@@ -592,4 +592,7 @@ pango_renderer_draw_glyphs (PangoRendere
   g_return_if_fail (PANGO_IS_RENDERER (renderer));
   
+  if (!font)
+    return;
+
   pango_renderer_activate (renderer);
 
Index: pango/shape.c
===================================================================
RCS file: /cvs/gnome/pango/pango/shape.c,v
retrieving revision 1.10
diff -p -u -2 -r1.10 shape.c
--- pango/shape.c	3 Aug 2003 21:57:33 -0000	1.10
+++ pango/shape.c	21 Dec 2004 23:12:52 -0000
@@ -44,5 +44,5 @@ pango_shape (const gchar      *text, 
   int last_cluster = -1;
   
-  if (analysis->shape_engine)
+  if (analysis->shape_engine && analysis->font)
     _pango_engine_shape_shape (analysis->shape_engine, analysis->font,
 			       text, length, analysis, glyphs);
