1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "font.h"
19 class WXDLLEXPORT wxFontRefData
: public wxGDIRefData
21 friend class WXDLLEXPORT wxFont
;
30 , m_faceName(wxT("Geneva"))
31 , m_encoding(wxFONTENCODING_DEFAULT
)
33 Init(10, wxDEFAULT
, wxNORMAL
, wxNORMAL
, FALSE
,
34 wxT("Geneva"), wxFONTENCODING_DEFAULT
);
37 wxFontRefData(const wxFontRefData
& data
)
39 , m_fontId(data
.m_fontId
)
40 , m_pointSize(data
.m_pointSize
)
41 , m_family(data
.m_family
)
42 , m_style(data
.m_style
)
43 , m_weight(data
.m_weight
)
44 , m_underlined(data
.m_underlined
)
45 , m_faceName(data
.m_faceName
)
46 , m_encoding(data
.m_encoding
)
48 Init(data
.m_pointSize
, data
.m_family
, data
.m_style
, data
.m_weight
,
49 data
.m_underlined
, data
.m_faceName
, data
.m_encoding
);
52 wxFontRefData(int size
,
57 const wxString
& faceName
,
58 wxFontEncoding encoding
)
64 , m_underlined(underlined
)
65 , m_faceName(faceName
)
66 , m_encoding(encoding
)
68 Init(size
, family
, style
, weight
, underlined
, faceName
, encoding
);
71 virtual ~wxFontRefData();
73 // common part of all ctors
79 const wxString
& faceName
,
80 wxFontEncoding encoding
);
82 // font characterstics
90 wxFontEncoding m_encoding
;
94 // ----------------------------------------------------------------------------
96 // ----------------------------------------------------------------------------
98 class WXDLLEXPORT wxFont
: public wxFontBase
103 wxFont(const wxFont
& font
)
114 bool underlined
= FALSE
,
115 const wxString
& face
= wxEmptyString
,
116 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
120 (void)Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
123 wxFont(const wxNativeFontInfo
& info
)
130 wxFont(const wxString
& fontDesc
);
132 bool Create(int size
,
136 bool underlined
= FALSE
,
137 const wxString
& face
= wxEmptyString
,
138 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
140 bool Create(const wxNativeFontInfo
& info
);
145 wxFont
& operator=(const wxFont
& font
);
147 // implement base class pure virtuals
148 virtual int GetPointSize() const;
149 virtual int GetFamily() const;
150 virtual int GetStyle() const;
151 virtual int GetWeight() const;
152 virtual bool GetUnderlined() const;
153 virtual wxString
GetFaceName() const;
154 virtual wxFontEncoding
GetEncoding() const;
155 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
157 virtual void SetPointSize(int pointSize
);
158 virtual void SetFamily(int family
);
159 virtual void SetStyle(int style
);
160 virtual void SetWeight(int weight
);
161 virtual void SetFaceName(const wxString
& faceName
);
162 virtual void SetUnderlined(bool underlined
);
163 virtual void SetEncoding(wxFontEncoding encoding
);
165 // implementation only from now on
166 // -------------------------------
168 virtual bool RealizeResource();
171 // common part of all ctors
177 DECLARE_DYNAMIC_CLASS(wxFont
)