]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/font.h
Controls will readjust their size and minsize when SetLabel or SetFont
[wxWidgets.git] / include / wx / mac / carbon / 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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "font.h"
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // wxFont
21 // ----------------------------------------------------------------------------
22
23 class WXDLLEXPORT wxFont : public wxFontBase
24 {
25 public:
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 bool MacCreateThemeFont( wxUint16 themeFontID ) ;
68
69 virtual ~wxFont();
70
71 // assignment
72 wxFont& operator=(const wxFont& font);
73
74 // implement base class pure virtuals
75 virtual int GetPointSize() const;
76 virtual int GetFamily() const;
77 virtual int GetStyle() const;
78 virtual int GetWeight() const;
79 virtual bool GetUnderlined() const;
80 virtual wxString GetFaceName() const;
81 virtual wxFontEncoding GetEncoding() const;
82 virtual const wxNativeFontInfo *GetNativeFontInfo() const;
83
84 virtual void SetPointSize(int pointSize);
85 virtual void SetFamily(int family);
86 virtual void SetStyle(int style);
87 virtual void SetWeight(int weight);
88 virtual void SetFaceName(const wxString& faceName);
89 virtual void SetUnderlined(bool underlined);
90 virtual void SetEncoding(wxFontEncoding encoding);
91
92 // implementation only from now on
93 // -------------------------------
94
95 virtual bool RealizeResource();
96
97 // Unofficial API, don't use
98 virtual void SetNoAntiAliasing( bool noAA = TRUE ) ;
99 virtual bool GetNoAntiAliasing() ;
100
101 // Mac-specific, risks to change, don't use in portable code
102 short MacGetFontNum() const;
103 short MacGetFontSize() const;
104 wxByte MacGetFontStyle() const;
105 wxUint32 MacGetATSUFontID() const;
106 wxUint32 MacGetATSUAdditionalQDStyles() const;
107 wxUint16 MacGetThemeFontID() const ;
108 protected:
109 // common part of all ctors
110 void Init();
111
112 void Unshare();
113
114 private:
115 DECLARE_DYNAMIC_CLASS(wxFont)
116 };
117
118 #endif
119 // _WX_FONT_H_