From 4145a30e06296b1a6165930ac371ba20c5e8fc7e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Nov 2017 17:58:50 +0100 Subject: [PATCH] Report errors if using private font fails in the font sample Give more information instead of just silently not showing the corresponding menu item. --- samples/font/font.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/samples/font/font.cpp b/samples/font/font.cpp index b02544644e..baa7f0b054 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -422,8 +422,15 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) #endif privfont << "wxprivate.ttf"; - if ( wxFont::AddPrivateFont(privfont) && - wxFont::ActivatePrivateFonts() ) + if ( !wxFont::AddPrivateFont(privfont) ) + { + wxLogWarning("Failed to add private font from \"%s\"", privfont); + } + else if ( !wxFont::ActivatePrivateFonts() ) + { + wxLogWarning("Failed to activate the private fonts"); + } + else { menuSelect->AppendSeparator(); menuSelect->Append(Font_Private,