1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
22 wxOSX_SYSTEM_FONT_NONE
= 0,
23 wxOSX_SYSTEM_FONT_NORMAL
,
24 wxOSX_SYSTEM_FONT_BOLD
,
25 wxOSX_SYSTEM_FONT_SMALL
,
26 wxOSX_SYSTEM_FONT_SMALL_BOLD
,
27 wxOSX_SYSTEM_FONT_MINI
,
28 wxOSX_SYSTEM_FONT_MINI_BOLD
,
29 wxOSX_SYSTEM_FONT_LABELS
,
30 wxOSX_SYSTEM_FONT_VIEWS
34 class WXDLLIMPEXP_CORE wxFont
: public wxFontBase
40 #if FUTURE_WXWIN_COMPATIBILITY_3_0
45 bool underlined
= false,
46 const wxString
& face
= wxEmptyString
,
47 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
49 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
57 bool underlined
= false,
58 const wxString
& face
= wxEmptyString
,
59 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
61 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
64 wxFont(const wxSize
& pixelSize
,
68 bool underlined
= false,
69 const wxString
& face
= wxEmptyString
,
70 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
72 Create(10, family
, style
, weight
, underlined
, face
, encoding
);
73 SetPixelSize(pixelSize
);
80 bool underlined
= false,
81 const wxString
& face
= wxEmptyString
,
82 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
84 wxFont(const wxNativeFontInfo
& info
)
89 wxFont(const wxString
& fontDesc
);
91 bool Create(const wxNativeFontInfo
& info
);
93 bool CreateSystemFont(wxOSXSystemFont font
);
97 // implement base class pure virtuals
98 virtual int GetPointSize() const;
99 virtual wxSize
GetPixelSize() const;
100 virtual wxFontFamily
GetFamily() const;
101 virtual wxFontStyle
GetStyle() const;
102 virtual wxFontWeight
GetWeight() const;
103 virtual bool GetUnderlined() const;
104 virtual wxString
GetFaceName() const;
105 virtual wxFontEncoding
GetEncoding() const;
106 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
108 virtual void SetPointSize(int pointSize
);
109 virtual void SetFamily(wxFontFamily family
);
110 virtual void SetStyle(wxFontStyle style
);
111 virtual void SetWeight(wxFontWeight weight
);
112 virtual bool SetFaceName(const wxString
& faceName
);
113 virtual void SetUnderlined(bool underlined
);
114 virtual void SetEncoding(wxFontEncoding encoding
);
116 WXDECLARE_COMPAT_SETTERS
118 // implementation only from now on
119 // -------------------------------
121 virtual bool RealizeResource();
123 // Unofficial API, don't use
124 virtual void SetNoAntiAliasing( bool noAA
= TRUE
) ;
125 virtual bool GetNoAntiAliasing() const ;
127 // Mac-specific, risks to change, don't use in portable code
129 #if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
130 wxUint16
MacGetThemeFontID() const ;
131 // 'old' Quickdraw accessors
132 short MacGetFontNum() const;
133 wxByte
MacGetFontStyle() const;
136 #if wxOSX_USE_COCOA_OR_CARBON
137 CGFontRef
GetCGFont() const;
140 #if wxOSX_USE_CORE_TEXT
141 CTFontRef
GetCTFont() const;
144 #if wxOSX_USE_ATSU_TEXT
145 // Returns an ATSUStyle not ATSUStyle*
146 void* MacGetATSUStyle() const ;
150 WX_NSFont
GetNSFont() const;
151 static WX_NSFont
CreateNSFont(wxOSXSystemFont font
, wxNativeFontInfo
* info
);
152 static WX_NSFont
CreateNSFont(const wxNativeFontInfo
* info
);
156 WX_UIFont
GetUIFont() const;
157 static WX_NSFont
CreateUIFont(wxOSXSystemFont font
, wxNativeFontInfo
* info
);
161 virtual wxGDIRefData
*CreateGDIRefData() const;
162 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
166 DECLARE_DYNAMIC_CLASS(wxFont
)
169 #endif // _WX_FONT_H_