- context = pango_xft_get_context (RrDisplay(f->inst), RrScreen(f->inst));
- pl = pango_layout_new (context);
- pango_layout_set_text(pl, str, -1);
- pango_layout_set_font_description(pl, f->pango_font_description);
- pango_layout_set_single_paragraph_mode(pl, TRUE);
- pango_layout_get_pixel_extents(pl, NULL, &rect);
- *x = rect.width + (f->shadow ? ABS(f->offset) : 0);
- *y = rect.height + (f->shadow ? ABS(f->offset) : 0);
- g_object_unref(pl);
- g_object_unref(context);
-
-#else
- XGlyphInfo info;
-
- XftTextExtentsUtf8(RrDisplay(f->inst), f->xftfont,
- (const FcChar8*)str, strlen(str), &info);
-
- *x = (signed) info.xOff + (f->shadow ? ABS(f->offset) : 0);
- *y = info.height + (f->shadow ? ABS(f->offset) : 0);
-#endif /* USE_PANGO */
+
+ pango_layout_set_text(f->layout, str, -1);
+ pango_layout_set_width(f->layout, -1);
+ pango_layout_get_pixel_extents(f->layout, NULL, &rect);
+ *x = rect.width + ABS(shadow_offset);
+ *y = rect.height + ABS(shadow_offset);