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