+static void
+draw_text (cairo_t *cr,
+ const gchar *text,
+ double x,
+ double y,
+ int width,
+ int height)
+{
+ PangoLayout *layout;
+ PangoFontDescription *desc;
+
+ /* Create a PangoLayout, set the font and text */
+ layout = pango_cairo_create_layout (cr);
+ pango_layout_set_text (layout,
+ text,
+ -1);
+ desc = pango_font_description_from_string ("Sans 17");
+ pango_layout_set_font_description (layout, desc);
+ pango_font_description_free (desc);
+
+ pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
+ pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END);
+ pango_layout_set_width (layout, PANGO_SCALE*width);
+ pango_layout_set_height (layout, PANGO_SCALE*height);
+
+ /* draw shadow */
+ cairo_move_to (cr, x + 1, y + 1);
+ cairo_set_source_rgba (cr, 0.2, 0.2, 0.2, 0.8);
+ pango_cairo_show_layout (cr, layout);
+
+ /* draw fg */
+ cairo_move_to (cr, x, y);
+ cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
+ pango_cairo_show_layout (cr, layout);
+
+ g_object_unref (layout);
+}
+