1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 class WXDLLIMPEXP_CORE wxFont
: public wxFontBase
25 #if FUTURE_WXWIN_COMPATIBILITY_3_0
30 bool underlined
= false,
31 const wxString
& face
= wxEmptyString
,
32 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
34 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
42 bool underlined
= false,
43 const wxString
& face
= wxEmptyString
,
44 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
46 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
53 bool underlined
= false,
54 const wxString
& face
= wxEmptyString
,
55 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
57 wxFont(const wxNativeFontInfo
& info
)
62 wxFont(const wxString
& fontDesc
);
64 bool Create(const wxNativeFontInfo
& info
);
66 #if wxOSX_USE_ATSU_TEXT
67 bool MacCreateFromThemeFont( wxUint16 themeFontID
) ;
69 #if wxOSX_USE_CORE_TEXT
70 bool MacCreateFromUIFont( wxUint32 coreTextFontType
);
71 bool MacCreateFromCTFontDescriptor( const void * ctFontDescriptor
, int pointSize
= 0 );
72 bool MacCreateFromCTFont( const void * ctFont
);
77 // implement base class pure virtuals
78 virtual int GetPointSize() const;
79 virtual wxSize
GetPixelSize() const;
80 virtual wxFontFamily
GetFamily() const;
81 virtual wxFontStyle
GetStyle() const;
82 virtual wxFontWeight
GetWeight() const;
83 virtual bool GetUnderlined() const;
84 virtual wxString
GetFaceName() const;
85 virtual wxFontEncoding
GetEncoding() const;
86 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
88 virtual void SetPointSize(int pointSize
);
89 virtual void SetFamily(wxFontFamily family
);
90 virtual void SetStyle(wxFontStyle style
);
91 virtual void SetWeight(wxFontWeight weight
);
92 virtual bool SetFaceName(const wxString
& faceName
);
93 virtual void SetUnderlined(bool underlined
);
94 virtual void SetEncoding(wxFontEncoding encoding
);
96 WXDECLARE_COMPAT_SETTERS
98 // implementation only from now on
99 // -------------------------------
101 virtual bool RealizeResource();
103 // Unofficial API, don't use
104 virtual void SetNoAntiAliasing( bool noAA
= TRUE
) ;
105 virtual bool GetNoAntiAliasing() const ;
107 // Mac-specific, risks to change, don't use in portable code
109 #if wxOSX_USE_ATSU_TEXT
110 // 'old' Quickdraw accessors
111 short MacGetFontNum() const;
112 short MacGetFontSize() const;
113 wxByte
MacGetFontStyle() const;
115 // 'new' ATSUI accessors
116 wxUint32
MacGetATSUFontID() const;
117 wxUint32
MacGetATSUAdditionalQDStyles() const;
118 wxUint16
MacGetThemeFontID() const ;
120 // Returns an ATSUStyle not ATSUStyle*
122 #if wxOSX_USE_CORE_TEXT
123 const void * MacGetCTFont() const;
125 #if wxOSX_USE_CORE_TEXT || wxOSX_USE_ATSU_TEXT
126 void* MacGetATSUStyle() const ;
130 virtual wxGDIRefData
*CreateGDIRefData() const;
131 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
136 DECLARE_DYNAMIC_CLASS(wxFont
)
139 #endif // _WX_FONT_H_