Report errors if using private font fails in the font sample

Give more information instead of just silently not showing the
corresponding menu item.
This commit is contained in:
Vadim Zeitlin 2017-11-07 17:58:50 +01:00
parent a7a59a263d
commit 4145a30e06

View File

@ -422,8 +422,15 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
#endif #endif
privfont << "wxprivate.ttf"; privfont << "wxprivate.ttf";
if ( wxFont::AddPrivateFont(privfont) && if ( !wxFont::AddPrivateFont(privfont) )
wxFont::ActivatePrivateFonts() ) {
wxLogWarning("Failed to add private font from \"%s\"", privfont);
}
else if ( !wxFont::ActivatePrivateFonts() )
{
wxLogWarning("Failed to activate the private fonts");
}
else
{ {
menuSelect->AppendSeparator(); menuSelect->AppendSeparator();
menuSelect->Append(Font_Private, menuSelect->Append(Font_Private,