/// 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
};
/**
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.
*/
};
-
/**
@class wxFont
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.
*/
wxString GetNativeFontInfoUserDesc() const;
+ const wxNativeFontInfo *GetNativeFontInfo() const;
+
/**
Gets the point size.
*/
wxFont Smaller() const;
+ /**
+ Returns underlined version of this font.
+
+ @see MakeUnderlined()
+
+ @since 2.9.2
+ */
+ wxFont Underlined() const;
+
/**
Changes this font to be bold.
*/
wxFont& MakeSmaller();
+ /**
+ Changes this font to be underlined.
+
+ @see Underlined()
+
+ @since 2.9.2
+ */
+ wxFont& MakeUnderlined();
+
/**
Changes the size of this font.
*/
bool SetNativeFontInfoUserDesc(const wxString& info);
+ void SetNativeFontInfo(const wxNativeFontInfo& info);
+
/**
Sets the point size.
*/
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.
int flags = wxFONTFLAG_DEFAULT,
const wxString& faceName = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+
+
+ static wxFont *New(const wxNativeFontInfo& nativeInfo);
+ static wxFont *New(const wxString& nativeInfoString);
+
//@}
};