diff -uNr pango_origin/pango/pango-layout.c pango_modify/pango/pango-layout.c
--- pango_origin/pango/pango-layout.c	2006-02-06 07:48:27.000000000 +0800
+++ pango_modify/pango/pango-layout.c	2006-02-09 17:36:08.000000000 +0800
@@ -325,6 +325,18 @@
   return layout->width;
 }
 
+int
+pango_layout_get_effective_width (PangoLayout *layout)
+{
+  int width;
+
+  width = pango_layout_get_width (layout);
+  if (width == -1)
+    pango_layout_get_size (layout, &width, NULL);
+
+  return width;
+}
+
 /**
  * pango_layout_set_wrap:
  * @layout: a #PangoLayout
@@ -2263,9 +2275,9 @@
   pango_layout_get_extents (layout, NULL, &logical_rect);
 
   if (width)
-    *width = logical_rect.width;
+    *width = logical_rect.x + logical_rect.width;
   if (height)
-    *height = logical_rect.height;
+    *height = logical_rect.y + logical_rect.height;
 }
 
 /**
@@ -2289,9 +2301,9 @@
   pango_layout_get_extents (layout, NULL, &logical_rect);
 
   if (width)
-    *width = (logical_rect.width + PANGO_SCALE / 2) / PANGO_SCALE;
+    *width = (logical_rect.x + logical_rect.width + PANGO_SCALE / 2) / PANGO_SCALE;
   if (height)
-    *height = (logical_rect.height + PANGO_SCALE / 2) / PANGO_SCALE;
+    *height = (logical_rect.y + logical_rect.height + PANGO_SCALE / 2) / PANGO_SCALE;
 }
 
 static void
diff -uNr pango_origin/pango/pango-layout.h pango_modify/pango/pango-layout.h
--- pango_origin/pango/pango-layout.h	2005-11-05 07:55:37.000000000 +0800
+++ pango_modify/pango/pango-layout.h	2006-02-09 17:32:48.000000000 +0800
@@ -122,6 +122,7 @@
 void           pango_layout_set_width            (PangoLayout                *layout,
 						  int                         width);
 int            pango_layout_get_width            (PangoLayout                *layout);
+int            pango_layout_get_effective_width  (PangoLayout                *layout);
 void           pango_layout_set_wrap             (PangoLayout                *layout,
                                                   PangoWrapMode               wrap);
 PangoWrapMode  pango_layout_get_wrap             (PangoLayout                *layout);
