Add FindOrCreateFont overload accepting wxFontInfo

This commit is contained in:
Maarten Bent
2017-11-25 17:04:11 +01:00
parent cbf13e68a2
commit 2156d29801
2 changed files with 14 additions and 0 deletions

View File

@@ -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;

View File

@@ -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);
};