+ if (string.IsEmpty())
+ {
+ if (width) (*width) = 0;
+ if (height) (*height) = 0;
+ return;
+ }
+
+#ifdef __WXGTK20__
+ // Set new font description
+ if (theFont)
+ pango_layout_set_font_description( m_layout, theFont->GetNativeFontInfo()->description );
+
+ // Set layout's text
+#if wxUSE_UNICODE
+ const wxCharBuffer data = wxConvUTF8.cWC2MB( string );
+ pango_layout_set_text( m_layout, (const char*) data, strlen( (const char*) data ));
+#else
+ const wxWCharBuffer wdata = wxConvLocal.cMB2WC( string );
+ const wxCharBuffer data = wxConvUTF8.cWC2MB( wdata );
+ pango_layout_set_text( m_layout, (const char*) data, strlen( (const char*) data ));
+#endif
+
+ int w,h;
+ pango_layout_get_pixel_size( m_layout, &w, &h );
+
+ if (width) (*width) = (wxCoord) w;
+ if (height) (*height) = (wxCoord) h;
+ if (descent)
+ {
+ // Do something about metrics here. TODO.
+ (*descent) = 0;
+ }
+ if (externalLeading) (*externalLeading) = 0; // ??
+
+ // Reset old font description
+ if (theFont)
+ pango_layout_set_font_description( m_layout, m_fontdesc );
+#else