]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/font.h
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
);
47 bool underlined
= FALSE
,
48 const wxString
& face
= wxEmptyString
,
49 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
54 wxFont
& operator=(const wxFont
& font
);
56 // implement base class pure virtuals
57 virtual int GetPointSize() const;
58 virtual int GetFamily() const;
59 virtual int GetStyle() const;
60 virtual int GetWeight() const;
61 virtual bool GetUnderlined() const;
62 virtual wxString
GetFaceName() const;
63 virtual wxFontEncoding
GetEncoding() const;
65 virtual void SetPointSize(int pointSize
);
66 virtual void SetFamily(int family
);
67 virtual void SetStyle(int style
);
68 virtual void SetWeight(int weight
);
69 virtual void SetFaceName(const wxString
& faceName
);
70 virtual void SetUnderlined(bool underlined
);
71 virtual void SetEncoding(wxFontEncoding encoding
);
73 // implementation only from now on
74 // -------------------------------
76 int GetFontId() const;
77 virtual bool IsFree() const;
78 virtual bool RealizeResource();
79 virtual WXHANDLE
GetResourceHandle();
80 virtual bool FreeResource(bool force
= FALSE
);
82 // for consistency with other wxMSW classes and to have a const
83 // GetResourceHandle()-like function we have a synonym for it
84 WXHFONT
GetHFONT() const;
87 virtual bool UseResource();
88 virtual bool ReleaseResource();
92 // common part of all ctors
98 DECLARE_DYNAMIC_CLASS(wxFont
)