1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "font.h"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
23 class WXDLLEXPORT wxFont
: public wxFontBase
28 wxFont(const wxFont
& font
) { Init(); Ref(font
); }
34 bool underlined
= FALSE
,
35 const wxString
& face
= wxEmptyString
,
36 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
40 (void)Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
43 wxFont(const wxNativeFontInfo
& info
)
47 (void)Create(info
.pointSize
, info
.family
, info
.style
, info
.weight
,
48 info
.underlined
, info
.faceName
, info
.encoding
);
55 bool underlined
= FALSE
,
56 const wxString
& face
= wxEmptyString
,
57 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
62 wxFont
& operator=(const wxFont
& font
);
64 // implement base class pure virtuals
65 virtual int GetPointSize() const;
66 virtual int GetFamily() const;
67 virtual int GetStyle() const;
68 virtual int GetWeight() const;
69 virtual bool GetUnderlined() const;
70 virtual wxString
GetFaceName() const;
71 virtual wxFontEncoding
GetEncoding() const;
73 virtual void SetPointSize(int pointSize
);
74 virtual void SetFamily(int family
);
75 virtual void SetStyle(int style
);
76 virtual void SetWeight(int weight
);
77 virtual void SetFaceName(const wxString
& faceName
);
78 virtual void SetUnderlined(bool underlined
);
79 virtual void SetEncoding(wxFontEncoding encoding
);
81 // implementation only from now on
82 // -------------------------------
84 int GetFontId() const;
85 virtual bool IsFree() const;
86 virtual bool RealizeResource();
87 virtual WXHANDLE
GetResourceHandle();
88 virtual bool FreeResource(bool force
= FALSE
);
90 // for consistency with other wxMSW classes and to have a const
91 // GetResourceHandle()-like function we have a synonym for it
92 WXHFONT
GetHFONT() const;
95 virtual bool UseResource();
96 virtual bool ReleaseResource();
100 // common part of all ctors
106 DECLARE_DYNAMIC_CLASS(wxFont
)