Index: gdk/gdkprivate.h
===================================================================
--- gdk/gdkprivate.h	(revision 17053)
+++ gdk/gdkprivate.h	(working copy)
@@ -50,6 +50,16 @@ void gdk_synthesize_window_state (GdkWin
                                   GdkWindowState unset_flags,
                                   GdkWindowState set_flags);
 
+/* Tests whether a pair of x,y may cause overflows when converted to Pango
+ * units (multiplied by PANGO_SCALE).  We don't allow the entire range, leave
+ * some space for additions afterwards, to be safe...
+ */
+#define GDK_PANGO_UNITS_OVERFLOWS(x,y) (G_UNLIKELY ( \
+	(y) >= PANGO_PIXELS (G_MAXINT-PANGO_SCALE)/2 || \
+	(x) >= PANGO_PIXELS (G_MAXINT-PANGO_SCALE)/2 || \
+	(y) <=-PANGO_PIXELS (G_MAXINT-PANGO_SCALE)/2 || \
+	(x) <=-PANGO_PIXELS (G_MAXINT-PANGO_SCALE)/2))
+
 G_END_DECLS
 
 #endif /* __GDK_PRIVATE_H__ */
Index: gdk/gdkpango.c
===================================================================
--- gdk/gdkpango.c	(revision 17053)
+++ gdk/gdkpango.c	(working copy)
@@ -844,8 +844,22 @@ gdk_draw_layout_line_with_colors (GdkDra
       PangoMatrix tmp_matrix;
       
       tmp_matrix = *matrix;
-      tmp_matrix.x0 = x;
-      tmp_matrix.y0 = y;
+      tmp_matrix.x0 += x;
+      tmp_matrix.y0 += y;
+      pango_renderer_set_matrix (renderer, &tmp_matrix);
+
+      x = 0;
+      y = 0;
+    }
+  /* Fall back to introduce a matrix if the coords would scale out of range.
+   * The x and y here will be added to in-layout coordinates.  So we cannot
+   * support the entire range here safely.  So, we just accept the middle half
+   * and use fallback for the rest. */
+  else if (GDK_PANGO_UNITS_OVERFLOWS (x, y))
+    {
+      PangoMatrix tmp_matrix = PANGO_MATRIX_INIT;
+      tmp_matrix.x0 += x;
+      tmp_matrix.y0 += y;
       pango_renderer_set_matrix (renderer, &tmp_matrix);
 
       x = 0;
@@ -968,6 +982,16 @@ gdk_draw_layout_with_colors (GdkDrawable
       x = 0;
       y = 0;
     }
+  else if (GDK_PANGO_UNITS_OVERFLOWS (x, y))
+    {
+      PangoMatrix tmp_matrix = PANGO_MATRIX_INIT;
+      tmp_matrix.x0 = x;
+      tmp_matrix.y0 = y;
+      pango_renderer_set_matrix (renderer, &tmp_matrix);
+
+      x = 0;
+      y = 0;
+    }
   else
     pango_renderer_set_matrix (renderer, NULL);
 
Index: gdk/gdkwindow.c
===================================================================
--- gdk/gdkwindow.c	(revision 17053)
+++ gdk/gdkwindow.c	(working copy)
@@ -1737,6 +1737,15 @@ gdk_window_draw_glyphs_transformed (GdkD
 	  tmp_matrix.y0 -= y_offset;
 	  matrix = &tmp_matrix;
 	}
+      else if (GDK_PANGO_UNITS_OVERFLOWS (x_offset, y_offset))
+	{
+	  PangoMatrix identity = PANGO_MATRIX_INIT;
+	  
+	  tmp_matrix = identity;
+	  tmp_matrix.x0 -= x_offset;
+	  tmp_matrix.y0 -= y_offset;
+	  matrix = &tmp_matrix;
+	}
       else
 	{
 	  x -= x_offset * PANGO_SCALE;
