git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32258
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxSize wxStaticText::DoGetBestSize() const
{
wxClientDC dc(wx_const_cast(wxStaticText *, this));
- dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
+ wxFont font(GetFont());
+ if (!font.Ok())
+ font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
+
+ dc.SetFont(font);
wxCoord widthTextMax, heightTextTotal;
dc.GetMultiLineTextExtent(GetLabel(), &widthTextMax, &heightTextTotal);