]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/font.h
01e7a41c76ab8be2dfa89b9d511373fc5e7e6c15
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 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
23 class WXDLLEXPORT wxFont
: public wxFontBase
28 wxFont(const wxFont
& font
) : wxFontBase(font
) { Init(); Ref(font
); }
34 bool underlined
= false,
35 const wxString
& face
= wxEmptyString
,
36 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
40 (void)Create(size
, wxSize(0, 0), FALSE
, family
, style
, weight
,
41 underlined
, face
, encoding
);
44 wxFont(const wxSize
& pixelSize
,
48 bool underlined
= false,
49 const wxString
& face
= wxEmptyString
,
50 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
54 (void)Create(0, pixelSize
, TRUE
, family
, style
, weight
, underlined
,
58 wxFont(const wxNativeFontInfo
& info
, WXHFONT hFont
= 0)
65 wxFont(const wxString
& fontDesc
);
68 const wxSize
& pixelSize
,
73 bool underlined
= false,
74 const wxString
& face
= wxEmptyString
,
75 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
77 bool Create(const wxNativeFontInfo
& info
, WXHFONT hFont
= 0);
82 wxFont
& operator=(const wxFont
& font
);
84 // implement base class pure virtuals
85 virtual int GetPointSize() const;
86 virtual wxSize
GetPixelSize() const;
87 virtual bool IsUsingSizeInPixels() const;
88 virtual int GetFamily() const;
89 virtual int GetStyle() const;
90 virtual int GetWeight() const;
91 virtual bool GetUnderlined() const;
92 virtual wxString
GetFaceName() const;
93 virtual wxFontEncoding
GetEncoding() const;
94 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
96 virtual void SetPointSize(int pointSize
);
97 virtual void SetPixelSize(const wxSize
& pixelSize
);
98 virtual void SetFamily(int family
);
99 virtual void SetStyle(int style
);
100 virtual void SetWeight(int weight
);
101 virtual void SetFaceName(const wxString
& faceName
);
102 virtual void SetUnderlined(bool underlined
);
103 virtual void SetEncoding(wxFontEncoding encoding
);
105 virtual bool IsFixedWidth() const;
107 // implementation only from now on
108 // -------------------------------
110 virtual bool IsFree() const;
111 virtual bool RealizeResource();
112 virtual WXHANDLE
GetResourceHandle() const;
113 virtual bool FreeResource(bool force
= false);
115 // for consistency with other wxMSW classes
116 WXHFONT
GetHFONT() const;
119 virtual bool UseResource();
120 virtual bool ReleaseResource();
124 virtual void DoSetNativeFontInfo(const wxNativeFontInfo
& info
);
126 // common part of all ctors
132 DECLARE_DYNAMIC_CLASS(wxFont
)