diff --git a/include/wx/font.h b/include/wx/font.h index 354f458396..27935bac55 100644 --- a/include/wx/font.h +++ b/include/wx/font.h @@ -558,6 +558,12 @@ public: wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { return FindOrCreateFont(pointSize, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underline, face, encoding); } + + wxFont *FindOrCreateFont(const wxFontInfo& fontInfo) + { return FindOrCreateFont(fontInfo.GetPointSize(), fontInfo.GetFamily(), + fontInfo.GetStyle(), fontInfo.GetWeight(), + fontInfo.IsUnderlined(), fontInfo.GetFaceName(), + fontInfo.GetEncoding()); } }; extern WXDLLIMPEXP_DATA_CORE(wxFontList*) wxTheFontList; diff --git a/interface/wx/font.h b/interface/wx/font.h index e798a95d84..1fcb7ab4b3 100644 --- a/interface/wx/font.h +++ b/interface/wx/font.h @@ -1261,6 +1261,14 @@ public: wxFontWeight weight, bool underline = false, const wxString& facename = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); + + /** + Finds a font of the given specification, or creates one and adds it to the + list. See the @ref wxFont "wxFont constructor" for details of the arguments. + + @since 3.1.1 + */ + wxFont* FindOrCreateFont(const wxFontInfo& fontInfo); };