+#if wxUSE_UNICODE
+ PangoLayout *layout = pango_layout_new(m_context);
+ pango_layout_set_font_description(layout, m_fontdesc);
+
+ const wxCharBuffer data = wxConvUTF8.cWC2MB( text );
+ pango_layout_set_text(layout, (const char*) data, strlen( (const char*) data ));
+
+ // Measure layout.
+ int w,h;
+ pango_layout_get_pixel_size(layout, &w, &h);
+ wxCoord width = w;
+ wxCoord height = h;
+
+ // Draw layout.
+ x11_draw_layout( (Drawable) m_window, (GC) m_textGC, x, y, layout, m_textForegroundColour );
+
+ g_object_unref( G_OBJECT( layout ) );
+
+ CalcBoundingBox (x + width, y + height);
+ CalcBoundingBox (x, y);
+#else
+ XFontStruct *xfont = (XFontStruct*) m_font.GetFontStruct( m_scaleY, m_display );
+
+ wxCHECK_RET( xfont, wxT("invalid font") );
+