]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/font.h
e20075f1ebd538ded02fc7be4a2ebaa113f52400
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 #include <wx/gdicmn.h>
21 // ----------------------------------------------------------------------------
23 // ----------------------------------------------------------------------------
25 class WXDLLEXPORT wxFont
: public wxFontBase
30 wxFont(const wxFont
& font
) : wxFontBase(font
) { Init(); Ref(font
); }
36 bool underlined
= false,
37 const wxString
& face
= wxEmptyString
,
38 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
42 (void)Create(size
, wxSize(0, 0), FALSE
, family
, style
, weight
,
43 underlined
, face
, encoding
);
46 wxFont(const wxSize
& pixelSize
,
50 bool underlined
= false,
51 const wxString
& face
= wxEmptyString
,
52 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
56 (void)Create(0, pixelSize
, TRUE
, family
, style
, weight
, underlined
,
60 wxFont(const wxNativeFontInfo
& info
, WXHFONT hFont
= 0)
67 wxFont(const wxString
& fontDesc
);
70 const wxSize
& pixelSize
,
75 bool underlined
= false,
76 const wxString
& face
= wxEmptyString
,
77 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
79 bool Create(const wxNativeFontInfo
& info
, WXHFONT hFont
= 0);
84 wxFont
& operator=(const wxFont
& font
);
86 // implement base class pure virtuals
87 virtual int GetPointSize() const;
88 virtual wxSize
GetPixelSize() const;
89 virtual bool IsUsingSizeInPixels() const;
90 virtual int GetFamily() const;
91 virtual int GetStyle() const;
92 virtual int GetWeight() const;
93 virtual bool GetUnderlined() const;
94 virtual wxString
GetFaceName() const;
95 virtual wxFontEncoding
GetEncoding() const;
96 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
98 virtual void SetPointSize(int pointSize
);
99 virtual void SetPixelSize(const wxSize
& pixelSize
);
100 virtual void SetFamily(int family
);
101 virtual void SetStyle(int style
);
102 virtual void SetWeight(int weight
);
103 virtual void SetFaceName(const wxString
& faceName
);
104 virtual void SetUnderlined(bool underlined
);
105 virtual void SetEncoding(wxFontEncoding encoding
);
107 virtual bool IsFixedWidth() const;
109 // implementation only from now on
110 // -------------------------------
112 virtual bool IsFree() const;
113 virtual bool RealizeResource();
114 virtual WXHANDLE
GetResourceHandle() const;
115 virtual bool FreeResource(bool force
= false);
117 // for consistency with other wxMSW classes
118 WXHFONT
GetHFONT() const;
121 virtual bool UseResource();
122 virtual bool ReleaseResource();
126 virtual void DoSetNativeFontInfo(const wxNativeFontInfo
& info
);
128 // common part of all ctors
134 DECLARE_DYNAMIC_CLASS(wxFont
)