void wxFont::SetPointSize(int pointSize)
{
- if ( M_FONTDATA->GetPointSize() == pointSize )
+ if ( M_FONTDATA != NULL && M_FONTDATA->GetPointSize() == pointSize )
return;
AllocExclusive();
bool wxFont::IsFixedWidth() const
{
- wxCHECK_MSG( M_FONTDATA != NULL , wxFONTWEIGHT_MAX, wxT("invalid font") );
+ wxCHECK_MSG( M_FONTDATA != NULL , false, wxT("invalid font") );
+ // cast away constness otherwise lazy font resolution is not possible
+ const_cast<wxFont *>(this)->RealizeResource();
+
return M_FONTDATA->IsFixedWidth();
}