Index: pango/pangocairo-font.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-font.c,v
retrieving revision 1.29
diff -u -p -d -r1.29 pangocairo-font.c
--- pango/pangocairo-font.c	28 Nov 2006 21:17:39 -0000	1.29
+++ pango/pangocairo-font.c	28 Nov 2006 21:45:38 -0000
@@ -72,7 +72,7 @@ gboolean
 _pango_cairo_font_install (PangoCairoFont *font,
 			   cairo_t        *cr)
 {
-  if (G_UNLIKELY (!font))
+  if (G_UNLIKELY (!PANGO_IS_CAIRO_FONT (font)))
     {
       if (!_pango_cairo_warning_history.font_install)
         {
@@ -89,7 +89,8 @@ _pango_cairo_font_install (PangoCairoFon
 cairo_font_face_t *
 _pango_cairo_font_get_font_face (PangoCairoFont *font)
 {
-  g_return_val_if_fail (font, NULL);
+  g_return_val_if_fail (PANGO_IS_CAIRO_FONT (font), NULL);
+  /* this function will be removed.  don't bother with warning history here */
   
   return (* PANGO_CAIRO_FONT_GET_IFACE (font)->get_font_face) (font);
 }
@@ -97,7 +98,15 @@ _pango_cairo_font_get_font_face (PangoCa
 cairo_scaled_font_t *
 _pango_cairo_font_get_scaled_font (PangoCairoFont *font)
 {
-  g_return_val_if_fail (font, NULL);
+  if (G_UNLIKELY (!PANGO_IS_CAIRO_FONT (font)))
+    {
+      if (!_pango_cairo_warning_history.font_get_scaled_font)
+        {
+	  _pango_cairo_warning_history.font_get_scaled_font = TRUE;
+	  g_warning ("_pango_cairo_font_get_scaled_font called with bad font, expect ugly output");
+	}
+      return NULL;
+    }
   
   return (* PANGO_CAIRO_FONT_GET_IFACE (font)->get_scaled_font) (font);
 }
Index: pango/pangocairo-private.h
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-private.h,v
retrieving revision 1.12
diff -u -p -d -r1.12 pangocairo-private.h
--- pango/pangocairo-private.h	3 Feb 2006 02:46:17 -0000	1.12
+++ pango/pangocairo-private.h	28 Nov 2006 21:45:38 -0000
@@ -108,6 +108,7 @@ typedef struct _PangoCairoWarningHistory
 
 struct _PangoCairoWarningHistory {
   guint font_install		: 1;
+  guint font_get_scaled_font	: 1;
 }; 
 
 extern PangoCairoWarningHistory _pango_cairo_warning_history;
Index: pango/pangocairo-render.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-render.c,v
retrieving revision 1.28
diff -u -p -d -r1.28 pangocairo-render.c
--- pango/pangocairo-render.c	28 Nov 2006 21:17:39 -0000	1.28
+++ pango/pangocairo-render.c	28 Nov 2006 21:45:38 -0000
@@ -177,7 +177,7 @@ pango_cairo_renderer_draw_glyphs (PangoR
   if (!crenderer->do_path)
     set_color (crenderer, PANGO_RENDER_PART_FOREGROUND);
 
-  if (!_pango_cairo_font_install (PANGO_CAIRO_FONT (font), crenderer->cr))
+  if (!_pango_cairo_font_install ((PangoCairoFont *) (font), crenderer->cr))
     {
       for (i = 0; i < glyphs->num_glyphs; i++)
 	{

