X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/59b7da02ff62a33862accc13158870f2a9a23630..ed3aceb08c9322375fb130bf840d106301ede6cd:/interface/wx/font.h diff --git a/interface/wx/font.h b/interface/wx/font.h index ffa5505743..c8de700f48 100644 --- a/interface/wx/font.h +++ b/interface/wx/font.h @@ -36,9 +36,10 @@ enum wxFontFamily /// See also wxFont::IsFixedWidth() for an easy way to test for monospace property. wxFONTFAMILY_TELETYPE = wxTELETYPE, + wxFONTFAMILY_MAX, /// Invalid font family value, returned by wxFont::GetFamily() when the /// font is invalid for example. - wxFONTFAMILY_UNKNOWN + wxFONTFAMILY_UNKNOWN = wxFONTFAMILY_MAX }; /** @@ -70,6 +71,27 @@ enum wxFontWeight wxFONTWEIGHT_MAX }; +/** + Symbolic font sizes. + + The elements of this enum correspond to CSS absolute size specifications, + see http://www.w3.org/TR/CSS21/fonts.html#font-size-props + + @see wxFont::SetSymbolicSize() + + @since 2.9.2 + */ +enum wxFontSymbolicSize +{ + wxFONTSIZE_XX_SMALL = -3, //!< Extra small. + wxFONTSIZE_X_SMALL, //!< Very small. + wxFONTSIZE_SMALL, //!< Small. + wxFONTSIZE_MEDIUM, //!< Normal. + wxFONTSIZE_LARGE, //!< Large. + wxFONTSIZE_X_LARGE, //!< Very large. + wxFONTSIZE_XX_LARGE //!< Extra large. +}; + /** The font flag bits for the new font ctor accepting one combined flags word. */ @@ -242,7 +264,6 @@ enum wxFontEncoding }; - /** @class wxFont @@ -380,7 +401,12 @@ public: If @a fontdesc is invalid the font remains uninitialized, i.e. its IsOk() method will return @false. */ - wxFont(const wxString& fontdesc); + wxFont(const wxString& nativeInfoString); + + /** + Construct font from a native font info structure. + */ + wxFont(const wxNativeFontInfo& nativeInfo); /** Destructor. @@ -465,6 +491,8 @@ public: */ wxString GetNativeFontInfoUserDesc() const; + const wxNativeFontInfo *GetNativeFontInfo() const; + /** Gets the point size. @@ -574,6 +602,15 @@ public: */ wxFont Smaller() const; + /** + Returns underlined version of this font. + + @see MakeUnderlined() + + @since 2.9.2 + */ + wxFont Underlined() const; + /** Changes this font to be bold. @@ -616,6 +653,15 @@ public: */ wxFont& MakeSmaller(); + /** + Changes this font to be underlined. + + @see Underlined() + + @since 2.9.2 + */ + wxFont& MakeUnderlined(); + /** Changes the size of this font. @@ -735,6 +781,8 @@ public: */ bool SetNativeFontInfoUserDesc(const wxString& info); + void SetNativeFontInfo(const wxNativeFontInfo& info); + /** Sets the point size. @@ -773,6 +821,28 @@ public: */ virtual void SetStyle(wxFontStyle style); + /** + Sets the font size using a predefined symbolic size name. + + This function allows to change font size to be (very) large or small + compared to the standard font size. + + @see SetSymbolicSizeRelativeTo(). + + @since 2.9.2 + */ + void SetSymbolicSize(wxFontSymbolicSize size); + + /** + Sets the font size compared to the base font size. + + This is the same as SetSymbolicSize() except that it uses the given + font size as the normal font size instead of the standard font size. + + @since 2.9.2 + */ + void SetSymbolicSizeRelativeTo(wxFontSymbolicSize size, int base); + /** Sets underlining. @@ -861,6 +931,11 @@ public: int flags = wxFONTFLAG_DEFAULT, const wxString& faceName = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); + + + static wxFont *New(const wxNativeFontInfo& nativeInfo); + static wxFont *New(const wxString& nativeInfoString); + //@} };