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
104 bool underlined
= FALSE
,
105 const wxString
& face
= wxEmptyString
,
106 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
108 (void)Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
111 wxFont(const wxNativeFontInfo
& info
)
116 wxFont(const wxString
& fontDesc
);
118 bool Create(int size
,
122 bool underlined
= FALSE
,
123 const wxString
& face
= wxEmptyString
,
124 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
126 bool Create(const wxNativeFontInfo
& info
);
130 // implement base class pure virtuals
131 virtual int GetPointSize() const;
132 virtual int GetFamily() const;
133 virtual int GetStyle() const;
134 virtual int GetWeight() const;
135 virtual bool GetUnderlined() const;
136 virtual wxString
GetFaceName() const;
137 virtual wxFontEncoding
GetEncoding() const;
138 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
140 virtual void SetPointSize(int pointSize
);
141 virtual void SetFamily(int family
);
142 virtual void SetStyle(int style
);
143 virtual void SetWeight(int weight
);
144 virtual bool SetFaceName(const wxString
& faceName
);
145 virtual void SetUnderlined(bool underlined
);
146 virtual void SetEncoding(wxFontEncoding encoding
);
148 // implementation only from now on
149 // -------------------------------
151 virtual bool RealizeResource();
157 DECLARE_DYNAMIC_CLASS(wxFont
)