]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/carbon/font.h
turning off QuickDraw on the iPhone
[wxWidgets.git] / include / wx / mac / carbon / font.h
CommitLineData
8cf73271
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
8cf73271
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_FONT_H_
13#define _WX_FONT_H_
14
8cf73271
SC
15// ----------------------------------------------------------------------------
16// wxFont
17// ----------------------------------------------------------------------------
18
19class WXDLLEXPORT wxFont : public wxFontBase
20{
21public:
22 // ctors and such
f8855e47 23 wxFont() { }
8cf73271
SC
24
25 wxFont(int size,
26 int family,
27 int style,
28 int weight,
29 bool underlined = FALSE,
30 const wxString& face = wxEmptyString,
31 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
32 {
8cf73271
SC
33 (void)Create(size, family, style, weight, underlined, face, encoding);
34 }
35
36 wxFont(const wxNativeFontInfo& info)
37 {
8cf73271
SC
38 (void)Create(info);
39 }
40
41 wxFont(const wxString& fontDesc);
42
43 bool Create(int size,
44 int family,
45 int style,
46 int weight,
47 bool underlined = FALSE,
48 const wxString& face = wxEmptyString,
49 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
50
51 bool Create(const wxNativeFontInfo& info);
52
da52a4e0 53 bool MacCreateFromThemeFont( wxUint16 themeFontID ) ;
16bdd5e4 54#if wxMAC_USE_CORE_TEXT
8f884a0d 55 bool MacCreateFromUIFont( wxUint32 coreTextFontType );
da52a4e0
SC
56 bool MacCreateFromCTFontDescriptor( const void * ctFontDescriptor, int pointSize = 0 );
57 bool MacCreateFromCTFont( const void * ctFont );
ebf2a1ec 58#endif
8f884a0d 59
8cf73271
SC
60 virtual ~wxFont();
61
8cf73271
SC
62 // implement base class pure virtuals
63 virtual int GetPointSize() const;
ccd67a6a 64 virtual wxSize GetPixelSize() const;
8cf73271
SC
65 virtual int GetFamily() const;
66 virtual int GetStyle() const;
67 virtual int GetWeight() const;
68 virtual bool GetUnderlined() const;
69 virtual wxString GetFaceName() const;
70 virtual wxFontEncoding GetEncoding() const;
71 virtual const wxNativeFontInfo *GetNativeFontInfo() const;
72
73 virtual void SetPointSize(int pointSize);
74 virtual void SetFamily(int family);
75 virtual void SetStyle(int style);
76 virtual void SetWeight(int weight);
85ab460e 77 virtual bool SetFaceName(const wxString& faceName);
8cf73271
SC
78 virtual void SetUnderlined(bool underlined);
79 virtual void SetEncoding(wxFontEncoding encoding);
80
81 // implementation only from now on
82 // -------------------------------
83
84 virtual bool RealizeResource();
85
86 // Unofficial API, don't use
87 virtual void SetNoAntiAliasing( bool noAA = TRUE ) ;
5ac2e80c 88 virtual bool GetNoAntiAliasing() const ;
8cf73271
SC
89
90 // Mac-specific, risks to change, don't use in portable code
8f884a0d 91
16bdd5e4 92#if wxMAC_USE_ATSU_TEXT
7bca6cef 93 // 'old' Quickdraw accessors
4f305456
SC
94 short MacGetFontNum() const;
95 short MacGetFontSize() const;
96 wxByte MacGetFontStyle() const;
8f884a0d 97
7bca6cef 98 // 'new' ATSUI accessors
4f305456
SC
99 wxUint32 MacGetATSUFontID() const;
100 wxUint32 MacGetATSUAdditionalQDStyles() const;
101 wxUint16 MacGetThemeFontID() const ;
ebf2a1ec 102
7bca6cef 103 // Returns an ATSUStyle not ATSUStyle*
16bdd5e4
SC
104#endif
105#if wxMAC_USE_CORE_TEXT
ebf2a1ec 106 const void * MacGetCTFont() const;
da52a4e0 107 const void * MacGetCTFontDescriptor() const;
ebf2a1ec 108#endif
bab4b13d 109#if wxMAC_USE_CORE_TEXT || wxMAC_USE_ATSU_TEXT
8f884a0d 110 void* MacGetATSUStyle() const ;
bab4b13d 111#endif
8f884a0d
VZ
112
113protected:
114 virtual wxGDIRefData *CreateGDIRefData() const;
115 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
116
83dcd781
PC
117private:
118 void Unshare();
8cf73271 119
8cf73271
SC
120 DECLARE_DYNAMIC_CLASS(wxFont)
121};
122
8f884a0d 123#endif // _WX_FONT_H_