1. added a brief overview of Unicode support
[wxWidgets.git] / include / wx / msw / font.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: font.h
3 // Purpose: wxFont class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_FONT_H_
13 #define _WX_FONT_H_
14
15 #ifdef __GNUG__
16 #pragma interface "font.h"
17 #endif
18
19 #include "wx/gdiobj.h"
20
21 WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
22
23 // ----------------------------------------------------------------------------
24 // wxFont
25 // ----------------------------------------------------------------------------
26
27 class WXDLLEXPORT wxFont : public wxFontBase
28 {
29 public:
30 // ctors and such
31 wxFont() { Init(); }
32 wxFont(const wxFont& font) { Init(); Ref(font); }
33
34 wxFont(int size,
35 int family,
36 int style,
37 int weight,
38 bool underlined = FALSE,
39 const wxString& face = wxEmptyString,
40 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
41 {
42 Init();
43
44 (void)Create(size, family, style, weight, underlined, face, encoding);
45 }
46
47 bool Create(int size,
48 int family,
49 int style,
50 int weight,
51 bool underlined = FALSE,
52 const wxString& face = wxEmptyString,
53 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
54
55 virtual ~wxFont();
56
57 // implement base class pure virtuals
58 virtual int GetPointSize() const;
59 virtual int GetFamily() const;
60 virtual int GetStyle() const;
61 virtual int GetWeight() const;
62 virtual bool GetUnderlined() const;
63 virtual wxString GetFaceName() const;
64 virtual wxFontEncoding GetEncoding() const;
65
66 virtual void SetPointSize(int pointSize);
67 virtual void SetFamily(int family);
68 virtual void SetStyle(int style);
69 virtual void SetWeight(int weight);
70 virtual void SetFaceName(const wxString& faceName);
71 virtual void SetUnderlined(bool underlined);
72 virtual void SetEncoding(wxFontEncoding encoding);
73
74 // implementation only from now on
75 // -------------------------------
76
77 int GetFontId() const;
78 virtual bool IsFree() const;
79 virtual bool RealizeResource();
80 virtual WXHANDLE GetResourceHandle();
81 virtual bool FreeResource(bool force = FALSE);
82 /*
83 virtual bool UseResource();
84 virtual bool ReleaseResource();
85 */
86
87 protected:
88 // common part of all ctors
89 void Init();
90
91 void Unshare();
92
93 private:
94 DECLARE_DYNAMIC_CLASS(wxFont)
95 };
96
97 #endif
98 // _WX_FONT_H_