1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 class WXDLLEXPORT wxFontRefData
: public wxGDIRefData
17 friend class WXDLLEXPORT wxFont
;
26 , m_faceName(wxT("Geneva"))
27 , m_encoding(wxFONTENCODING_DEFAULT
)
29 Init(10, wxDEFAULT
, wxNORMAL
, wxNORMAL
, FALSE
,
30 wxT("Geneva"), wxFONTENCODING_DEFAULT
);
33 wxFontRefData(const wxFontRefData
& data
)
35 , m_fontId(data
.m_fontId
)
36 , m_pointSize(data
.m_pointSize
)
37 , m_family(data
.m_family
)
38 , m_style(data
.m_style
)
39 , m_weight(data
.m_weight
)
40 , m_underlined(data
.m_underlined
)
41 , m_faceName(data
.m_faceName
)
42 , m_encoding(data
.m_encoding
)
44 Init(data
.m_pointSize
, data
.m_family
, data
.m_style
, data
.m_weight
,
45 data
.m_underlined
, data
.m_faceName
, data
.m_encoding
);
48 wxFontRefData(int size
,
53 const wxString
& faceName
,
54 wxFontEncoding encoding
)
60 , m_underlined(underlined
)
61 , m_faceName(faceName
)
62 , m_encoding(encoding
)
64 Init(size
, family
, style
, weight
, underlined
, faceName
, encoding
);
67 virtual ~wxFontRefData();
69 // common part of all ctors
75 const wxString
& faceName
,
76 wxFontEncoding encoding
);
78 // font characterstics
86 wxFontEncoding m_encoding
;
90 // ----------------------------------------------------------------------------
92 // ----------------------------------------------------------------------------
94 class WXDLLEXPORT wxFont
: public wxFontBase
99 wxFont(const wxFont
& font
)
110 bool underlined
= FALSE
,
111 const wxString
& face
= wxEmptyString
,
112 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
116 (void)Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
119 wxFont(const wxNativeFontInfo
& info
)
126 wxFont(const wxString
& fontDesc
);
128 bool Create(int size
,
132 bool underlined
= FALSE
,
133 const wxString
& face
= wxEmptyString
,
134 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
136 bool Create(const wxNativeFontInfo
& info
);
141 wxFont
& operator=(const wxFont
& font
);
143 // implement base class pure virtuals
144 virtual int GetPointSize() const;
145 virtual int GetFamily() const;
146 virtual int GetStyle() const;
147 virtual int GetWeight() const;
148 virtual bool GetUnderlined() const;
149 virtual wxString
GetFaceName() const;
150 virtual wxFontEncoding
GetEncoding() const;
151 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
153 virtual void SetPointSize(int pointSize
);
154 virtual void SetFamily(int family
);
155 virtual void SetStyle(int style
);
156 virtual void SetWeight(int weight
);
157 virtual void SetFaceName(const wxString
& faceName
);
158 virtual void SetUnderlined(bool underlined
);
159 virtual void SetEncoding(wxFontEncoding encoding
);
161 // implementation only from now on
162 // -------------------------------
164 virtual bool RealizeResource();
167 // common part of all ctors
173 DECLARE_DYNAMIC_CLASS(wxFont
)