]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/font.h
06c17b10b12d366f4bb6b64e22f7ce81fad36a64
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
, WXHFONT hFont
= 0)
50 wxFont(const wxString
& fontDesc
);
56 bool underlined
= FALSE
,
57 const wxString
& face
= wxEmptyString
,
58 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
60 bool Create(const wxNativeFontInfo
& info
, WXHFONT hFont
= 0);
65 wxFont
& operator=(const wxFont
& font
);
67 // implement base class pure virtuals
68 virtual int GetPointSize() const;
69 virtual int GetFamily() const;
70 virtual int GetStyle() const;
71 virtual int GetWeight() const;
72 virtual bool GetUnderlined() const;
73 virtual wxString
GetFaceName() const;
74 virtual wxFontEncoding
GetEncoding() const;
75 virtual wxNativeFontInfo
* GetNativeFontInfo() const;
77 virtual void SetPointSize(int pointSize
);
78 virtual void SetFamily(int family
);
79 virtual void SetStyle(int style
);
80 virtual void SetWeight(int weight
);
81 virtual void SetFaceName(const wxString
& faceName
);
82 virtual void SetUnderlined(bool underlined
);
83 virtual void SetEncoding(wxFontEncoding encoding
);
84 virtual void SetNativeFontInfo(const wxNativeFontInfo
& info
);
86 virtual bool IsFixedWidth() const;
88 // implementation only from now on
89 // -------------------------------
91 virtual bool IsFree() const;
92 virtual bool RealizeResource();
93 virtual WXHANDLE
GetResourceHandle();
94 virtual bool FreeResource(bool force
= FALSE
);
96 // for consistency with other wxMSW classes and to have a const
97 // GetResourceHandle()-like function we have a synonym for it
98 WXHFONT
GetHFONT() const;
101 virtual bool UseResource();
102 virtual bool ReleaseResource();
106 // common part of all ctors
112 DECLARE_DYNAMIC_CLASS(wxFont
)