]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/classic/font.h
wxPalette unified. Source cleaning.
[wxWidgets.git] / include / wx / mac / classic / 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 // ----------------------------------------------------------------------------
16 // wxFont
17 // ----------------------------------------------------------------------------
18
19 class WXDLLEXPORT wxFont : public wxFontBase
20 {
21 public:
22 // ctors and such
23 wxFont() { Init(); }
24 wxFont(const wxFont& font)
25 : wxFontBase()
26 {
27 Init();
28 Ref(font);
29 }
30
31 wxFont(int size,
32 int family,
33 int style,
34 int weight,
35 bool underlined = FALSE,
36 const wxString& face = wxEmptyString,
37 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
38 {
39 Init();
40
41 (void)Create(size, family, style, weight, underlined, face, encoding);
42 }
43
44 wxFont(const wxNativeFontInfo& info)
45 {
46 Init();
47
48 (void)Create(info);
49 }
50
51 wxFont(const wxString& fontDesc);
52
53 bool Create(int size,
54 int family,
55 int style,
56 int weight,
57 bool underlined = FALSE,
58 const wxString& face = wxEmptyString,
59 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
60
61 bool Create(const wxNativeFontInfo& info);
62
63 virtual ~wxFont();
64
65 // assignment
66 wxFont& operator=(const wxFont& font);
67
68 // implement base class pure virtuals
69 virtual int GetPointSize() const;
70 virtual int GetFamily() const;
71 virtual int GetStyle() const;
72 virtual int GetWeight() const;
73 virtual bool GetUnderlined() const;
74 virtual wxString GetFaceName() const;
75 virtual wxFontEncoding GetEncoding() const;
76 virtual const wxNativeFontInfo *GetNativeFontInfo() const;
77
78 virtual void SetPointSize(int pointSize);
79 virtual void SetFamily(int family);
80 virtual void SetStyle(int style);
81 virtual void SetWeight(int weight);
82 virtual void SetFaceName(const wxString& faceName);
83 virtual void SetUnderlined(bool underlined);
84 virtual void SetEncoding(wxFontEncoding encoding);
85
86 // implementation only from now on
87 // -------------------------------
88
89 virtual bool RealizeResource();
90
91 // Unofficial API, don't use
92 virtual void SetNoAntiAliasing( bool noAA = TRUE ) ;
93 virtual bool GetNoAntiAliasing() const ;
94
95 // Mac-specific, risks to change, don't use in portable code
96 short GetMacFontNum() const;
97 short GetMacFontSize() const;
98 wxByte GetMacFontStyle() const;
99 wxUint32 GetMacATSUFontID() const;
100
101 protected:
102 // common part of all ctors
103 void Init();
104
105 void Unshare();
106
107 private:
108 DECLARE_DYNAMIC_CLASS(wxFont)
109 };
110
111 #endif
112 // _WX_FONT_H_