2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: font.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxFont
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxFont
|
|
|
|
@wxheader{font.h}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
A font is an object which determines the appearance of text. Fonts are
|
|
|
|
used for drawing text to a device context, and setting the appearance of
|
|
|
|
a window's text.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
This class uses @ref overview_trefcount "reference counting and copy-on-write"
|
|
|
|
internally so that assignments between two instances of this class are very
|
|
|
|
cheap. You can therefore use actual objects instead of pointers without
|
|
|
|
efficiency problems. If an instance of this class is changed it will create
|
|
|
|
its own data internally so that other instances, which previously shared the
|
|
|
|
data using the reference counting, are not affected.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
You can retrieve the current system font settings with wxSystemSettings.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
wxSystemSettings
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{gdi}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@stdobjects
|
2008-03-10 11:24:38 -04:00
|
|
|
::Objects:, ::wxNullFont, ::Pointers:, ::wxNORMAL_FONT, ::wxSMALL_FONT,
|
|
|
|
::wxITALIC_FONT, ::wxSWISS_FONT,
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see @ref overview_wxfontoverview, wxDC::SetFont, wxDC::DrawText,
|
2008-03-08 08:52:38 -05:00
|
|
|
wxDC::GetTextExtent, wxFontDialog, wxSystemSettings
|
|
|
|
*/
|
|
|
|
class wxFont : public wxGDIObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Creates a font object with the specified attributes.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pointSize
|
2008-03-09 08:33:59 -04:00
|
|
|
Size in points.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pixelSize
|
2008-03-09 08:33:59 -04:00
|
|
|
Size in pixels: this is directly supported only under MSW
|
|
|
|
currently where this constructor can be used directly, under other
|
|
|
|
platforms a
|
|
|
|
font with the closest size to the given one is found using binary search and
|
|
|
|
the static New method must be used.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param family
|
2008-03-09 08:33:59 -04:00
|
|
|
Font family, a generic way of referring to fonts without specifying actual
|
2008-03-08 08:52:38 -05:00
|
|
|
facename. One of:
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_DEFAULT
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Chooses a default font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_DECORATIVE
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A decorative font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_ROMAN
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A formal, serif font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_SCRIPT
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A handwriting font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_SWISS
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A sans-serif font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_MODERN
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A fixed pitch font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_TELETYPE
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A teletype font.
|
|
|
|
@param style
|
|
|
|
One of wxFONTSTYLE_NORMAL, wxFONTSTYLE_SLANT and wxFONTSTYLE_ITALIC.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param weight
|
2008-03-09 08:33:59 -04:00
|
|
|
Font weight, sometimes also referred to as font boldness. One of:
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTWEIGHT_NORMAL
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Normal font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTWEIGHT_LIGHT
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Light font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTWEIGHT_BOLD
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Bold font.
|
|
|
|
@param underline
|
|
|
|
The value can be @true or @false. At present this has an effect on Windows
|
|
|
|
and Motif 2.x only.
|
|
|
|
@param faceName
|
|
|
|
An optional string specifying the actual typeface to be used. If it is an
|
|
|
|
empty string,
|
|
|
|
a default typeface will be chosen based on the family.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param encoding
|
2008-03-09 08:33:59 -04:00
|
|
|
An encoding which may be one of
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTENCODING_SYSTEM
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Default system encoding.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTENCODING_DEFAULT
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Default application encoding: this
|
|
|
|
is the encoding set by calls to
|
|
|
|
SetDefaultEncoding and which may be set to,
|
|
|
|
say, KOI8 to create all fonts by default with KOI8 encoding. Initially, the
|
|
|
|
default application encoding is the same as default system encoding.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTENCODING_ISO8859_1...15
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
ISO8859 encodings.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTENCODING_KOI8
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
The standard Russian encoding for Internet.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTENCODING_CP1250...1252
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Windows encodings similar to ISO8859 (but not identical).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
If the specified encoding isn't available, no font is created
|
|
|
|
(see also font encoding overview).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks If the desired font does not exist, the closest match will be
|
2008-03-09 08:33:59 -04:00
|
|
|
chosen. Under Windows, only scalable TrueType fonts are
|
|
|
|
used.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxFont();
|
2008-03-08 09:43:31 -05:00
|
|
|
wxFont(const wxFont& font);
|
|
|
|
wxFont(int pointSize, wxFontFamily family, int style,
|
|
|
|
wxFontWeight weight,
|
2008-03-09 08:33:59 -04:00
|
|
|
const bool underline = false,
|
2008-03-08 09:43:31 -05:00
|
|
|
const wxString& faceName = "",
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
|
|
|
wxFont(const wxSize& pixelSize, wxFontFamily family,
|
|
|
|
int style, wxFontWeight weight,
|
2008-03-09 08:33:59 -04:00
|
|
|
const bool underline = false,
|
2008-03-08 09:43:31 -05:00
|
|
|
const wxString& faceName = "",
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
See @ref overview_refcountdestruct "reference-counted object destruction" for
|
|
|
|
more info.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks Although all remaining fonts are deleted when the application
|
2008-03-09 08:33:59 -04:00
|
|
|
exits, the application should try to clean up all fonts
|
|
|
|
itself. This is because wxWidgets cannot know if a
|
|
|
|
pointer to the font object is stored in an application
|
|
|
|
data structure, and there is a risk of double deletion.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
~wxFont();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the current application's default encoding.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see @ref overview_wxfontencodingoverview, SetDefaultEncoding()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
static wxFontEncoding GetDefaultEncoding();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the typeface name associated with the font, or the empty string if
|
|
|
|
there is no
|
|
|
|
typeface information.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetFaceName()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxString GetFaceName() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the font family. See SetFamily() for a list of valid
|
|
|
|
family identifiers.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetFamily()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxFontFamily GetFamily() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the platform-dependent string completely describing this font.
|
|
|
|
Returned string is always non-empty.
|
|
|
|
Note that the returned string is not meant to be shown or edited by the user: a
|
|
|
|
typical
|
|
|
|
use of this function is for serializing in string-form a wxFont object.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetNativeFontInfo(),GetNativeFontInfoUserDesc()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxString GetNativeFontInfoDesc() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns a user-friendly string for this font object. Returned string is always
|
|
|
|
non-empty.
|
|
|
|
Some examples of the formats of returned strings (which are platform-dependent)
|
|
|
|
are in SetNativeFontInfoUserDesc().
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetNativeFontInfoDesc()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxString GetNativeFontInfoUserDesc();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the point size.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetPointSize()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetPointSize() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the font style. See wxFont() for a list of valid
|
|
|
|
styles.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetStyle()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetStyle() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the font is underlined, @false otherwise.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetUnderlined()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool GetUnderlined() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the font weight. See wxFont() for a list of valid
|
|
|
|
weight identifiers.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetWeight()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxFontWeight GetWeight() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the font is a fixed width (or monospaced) font,
|
|
|
|
@false if it is a proportional one or font is invalid.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool IsFixedWidth() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if this object is a valid font, @false otherwise.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool IsOk() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
These functions take the same parameters as @ref ctor() wxFont
|
|
|
|
constructor and return a new font object allocated on the heap.
|
|
|
|
Using @c New() is currently the only way to directly create a font with
|
|
|
|
the given size in pixels on platforms other than wxMSW.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
static wxFont* New(int pointSize, wxFontFamily family, int style,
|
|
|
|
wxFontWeight weight,
|
|
|
|
const bool underline = false,
|
|
|
|
const wxString& faceName = "",
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
|
|
|
static wxFont* New(int pointSize, wxFontFamily family,
|
|
|
|
int flags = wxFONTFLAG_DEFAULT,
|
|
|
|
const wxString& faceName = "",
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
|
|
|
static wxFont* New(const wxSize& pixelSize,
|
|
|
|
wxFontFamily family,
|
|
|
|
int style,
|
|
|
|
wxFontWeight weight,
|
|
|
|
const bool underline = false,
|
|
|
|
const wxString& faceName = "",
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
|
|
|
static wxFont* New(const wxSize& pixelSize,
|
|
|
|
wxFontFamily family,
|
|
|
|
int flags = wxFONTFLAG_DEFAULT,
|
|
|
|
const wxString& faceName = "",
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the default font encoding.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see @ref overview_wxfontencodingoverview, GetDefaultEncoding()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
static void SetDefaultEncoding(wxFontEncoding encoding);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the facename for the font.
|
|
|
|
Returns @true if the given face name exists; @false otherwise.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param faceName
|
2008-03-09 08:33:59 -04:00
|
|
|
A valid facename, which should be on the end-user's system.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks To avoid portability problems, don't rely on a specific face,
|
2008-03-09 08:33:59 -04:00
|
|
|
but specify the font family instead or as well. A
|
|
|
|
suitable font will be found on the end-user's system.
|
|
|
|
If both the family and the facename are specified,
|
|
|
|
wxWidgets will first search for the specific face, and
|
|
|
|
then for a font belonging to the same family.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetFaceName(), SetFamily()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool SetFaceName(const wxString& faceName);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the font family.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param family
|
2008-03-09 08:33:59 -04:00
|
|
|
One of:
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_DEFAULT
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Chooses a default font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_DECORATIVE
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A decorative font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_ROMAN
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A formal, serif font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_SCRIPT
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A handwriting font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_SWISS
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A sans-serif font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_MODERN
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A fixed pitch font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTFAMILY_TELETYPE
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
A teletype font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetFamily(), SetFaceName()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetFamily(wxFontFamily family);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Creates the font corresponding to the given native font description string and
|
|
|
|
returns @true if
|
|
|
|
the creation was successful.
|
|
|
|
which must have been previously returned by
|
|
|
|
GetNativeFontInfoDesc(). If the string is
|
|
|
|
invalid, font is unchanged. This function is typically used for de-serializing
|
|
|
|
a wxFont
|
|
|
|
object previously saved in a string-form.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetNativeFontInfoUserDesc()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool SetNativeFontInfo(const wxString& info);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Creates the font corresponding to the given native font description string and
|
|
|
|
returns @true if
|
|
|
|
the creation was successful.
|
|
|
|
Unlike SetNativeFontInfo(), this function accepts
|
|
|
|
strings which are user-friendly.
|
|
|
|
Examples of accepted string formats are:
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Generic syntax
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Example
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
on @b wxGTK2: @c [FACE-NAME] [bold] [oblique|italic] [POINTSIZE]
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Monospace bold 10
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
on @b wxMSW: @c [light|bold] [italic] [FACE-NAME] [POINTSIZE] [ENCODING]
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Tahoma 10 WINDOWS-1252
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
on @b wxMac: FIXME
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
FIXME
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
For more detailed information about the allowed syntaxes you can look at the
|
|
|
|
documentation of the native API used for font-rendering (e.g. pango_font_description_from_string).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetNativeFontInfo()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool SetNativeFontInfoUserDesc(const wxString& info);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the point size.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pointSize
|
2008-03-09 08:33:59 -04:00
|
|
|
Size in points.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetPointSize()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetPointSize(int pointSize);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the font style.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
One of wxFONTSTYLE_NORMAL, wxFONTSTYLE_SLANT and wxFONTSTYLE_ITALIC.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetStyle()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetStyle(int style);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets underlining.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param underlining
|
2008-03-09 08:33:59 -04:00
|
|
|
@true to underline, @false otherwise.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetUnderlined()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetUnderlined(const bool underlined);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the font weight.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param weight
|
2008-03-09 08:33:59 -04:00
|
|
|
One of:
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTWEIGHT_NORMAL
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Normal font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTWEIGHT_LIGHT
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Light font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
wxFONTWEIGHT_BOLD
|
2008-03-20 09:45:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Bold font.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetWeight()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetWeight(wxFontWeight weight);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Inequality operator.
|
|
|
|
See @ref overview_refcountequality "reference-counted object comparison" for
|
|
|
|
more info.
|
|
|
|
*/
|
|
|
|
bool operator !=(const wxFont& font);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Assignment operator, using @ref overview_trefcount "reference counting".
|
|
|
|
*/
|
|
|
|
wxFont operator =(const wxFont& font);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Equality operator.
|
|
|
|
See @ref overview_refcountequality "reference-counted object comparison" for
|
|
|
|
more info.
|
|
|
|
*/
|
|
|
|
bool operator ==(const wxFont& font);
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
FIXME
|
|
|
|
*/
|
2008-03-23 14:24:32 -04:00
|
|
|
wxFont wxNullFont;
|
2008-03-10 11:24:38 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
FIXME
|
|
|
|
*/
|
2008-03-23 14:24:32 -04:00
|
|
|
wxFont wxNORMAL_FONT;
|
2008-03-10 11:24:38 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
FIXME
|
|
|
|
*/
|
2008-03-23 14:24:32 -04:00
|
|
|
wxFont wxSMALL_FONT;
|
2008-03-10 11:24:38 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
FIXME
|
|
|
|
*/
|
2008-03-23 14:24:32 -04:00
|
|
|
wxFont wxITALIC_FONT;
|
2008-03-10 11:24:38 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
FIXME
|
|
|
|
*/
|
2008-03-23 14:24:32 -04:00
|
|
|
wxFont wxSWISS_FONT;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Global functions/macros
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
/** @ingroup group_funcmacro_misc */
|
|
|
|
//@{
|
2008-03-10 11:24:38 -04:00
|
|
|
|
|
|
|
/**
|
2008-03-23 14:24:32 -04:00
|
|
|
Converts string to a wxFont best represented by the given string. Returns
|
|
|
|
@true on success.
|
|
|
|
|
|
|
|
@see wxToString(const wxFont&)
|
|
|
|
|
|
|
|
@header{wx/font.h}
|
2008-03-10 11:24:38 -04:00
|
|
|
*/
|
2008-03-23 14:24:32 -04:00
|
|
|
bool wxFromString(const wxString& string, wxFont* font);
|
2008-03-10 11:24:38 -04:00
|
|
|
|
|
|
|
/**
|
2008-03-23 14:24:32 -04:00
|
|
|
Converts the given wxFont into a string.
|
|
|
|
|
|
|
|
@see wxFromString(const wxString&, wxFont*)
|
|
|
|
|
|
|
|
@header{wx/font.h}
|
2008-03-10 11:24:38 -04:00
|
|
|
*/
|
2008-03-23 14:24:32 -04:00
|
|
|
wxString wxToString(const wxFont& font);
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-23 14:24:32 -04:00
|
|
|
//@}
|
2008-03-10 11:24:38 -04:00
|
|
|
|