X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9f2968ad0ba775e6785c3eb4a3fea5ad19352e26..6f0b6fd1e4b5b2633e1f34c54c8d4f4e5da98637:/src/gtk/settings.cpp diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 6e5e0f363f..35f0649a37 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -19,6 +19,7 @@ #endif #include "wx/fontutil.h" +#include "wx/fontenum.h" #include #include "wx/gtk/private/win_gtk.h" @@ -227,11 +228,12 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) case wxSYS_COLOUR_MAX: default: - wxFAIL_MSG( _T("unknown system colour index") ); + wxFAIL_MSG( wxT("unknown system colour index") ); color = *wxWHITE; break; } + wxASSERT(color.IsOk()); return color; } @@ -255,6 +257,15 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) wxNativeFontInfo info; info.description = ButtonStyle()->font_desc; gs_fontSystem = wxFont(info); + +#if wxUSE_FONTENUM + // (try to) heal the default font (on some common systems e.g. Ubuntu + // it's "Sans Serif" but the real font is called "Sans"): + if (!wxFontEnumerator::IsValidFacename(gs_fontSystem.GetFaceName()) && + gs_fontSystem.GetFaceName() == "Sans Serif") + gs_fontSystem.SetFaceName("Sans"); +#endif // wxUSE_FONTENUM + info.description = NULL; } font = gs_fontSystem; @@ -263,6 +274,9 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) default: break; } + + wxASSERT( font.IsOk() ); + return font; }