int StringHeight(Gtk.Widget w, string text) { int wi, he; Pango.Layout lo = w.CreatePangoLayout(text); lo.GetPixelSize(out wi, out he); lo.Dispose(); return(he); }
int StringWidth(Gtk.Widget w, string text) { int wi, he; Pango.Layout lo = w.CreatePangoLayout(text); lo.FontDescription = w.Style.FontDesc; lo.GetPixelSize(out wi, out he); lo.Dispose(); return(wi); }