diff --git a/include/wx/font.h b/include/wx/font.h index cc7057a08d..b6826df56d 100644 --- a/include/wx/font.h +++ b/include/wx/font.h @@ -164,6 +164,16 @@ public: { SetFlag(wxFONTFLAG_ITALIC, italic); return *this; } wxFontInfo& Slant(bool slant = true) { SetFlag(wxFONTFLAG_SLANT, slant); return *this; } + wxFontInfo& Style(wxFontStyle style) + { + if ( style == wxFONTSTYLE_ITALIC ) + return Italic(); + + if ( style == wxFONTSTYLE_SLANT ) + return Slant(); + + return *this; + } wxFontInfo& AntiAliased(bool antiAliased = true) { SetFlag(wxFONTFLAG_ANTIALIASED, antiAliased); return *this; } diff --git a/interface/wx/font.h b/interface/wx/font.h index 8c356b9cc8..df3b25b65a 100644 --- a/interface/wx/font.h +++ b/interface/wx/font.h @@ -398,6 +398,9 @@ public: /** Use an italic version of the font. + This is a wrapper for Style() calling it with ::wxFONTSTYLE_ITALIC + argument. + @see ::wxFontStyle, wxFont::SetStyle() */ wxFontInfo& Italic(bool italic = true); @@ -405,10 +408,20 @@ public: /** Use a slanted version of the font. + This is a wrapper for Style() calling it with ::wxFONTSTYLE_SLANT + argument. + @see ::wxFontStyle, wxFont::SetStyle() */ wxFontInfo& Slant(bool slant = true); + /** + Specify the style of the font using one of wxFontStyle constants. + + @since 3.1.2 + */ + wxFontInfo& Style(wxFontStyle style); + /** Set anti-aliasing flag.