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
29 bool underlined
= FALSE
,
30 const wxString
& face
= wxEmptyString
,
31 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
33 (void)Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
36 wxFont(const wxNativeFontInfo
& info
)
41 wxFont(const wxString
& fontDesc
);
47 bool underlined
= FALSE
,
48 const wxString
& face
= wxEmptyString
,
49 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
51 bool Create(const wxNativeFontInfo
& info
);
53 bool MacCreateFromThemeFont( wxUint16 themeFontID
) ;
54 #if wxMAC_USE_CORE_TEXT
55 bool MacCreateFromUIFont( wxUint32 coreTextFontType
);
56 bool MacCreateFromCTFontDescriptor( const void * ctFontDescriptor
, int pointSize
= 0 );
57 bool MacCreateFromCTFont( const void * ctFont
);
62 // implement base class pure virtuals
63 virtual int GetPointSize() const;
64 virtual wxSize
GetPixelSize() const;
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;
73 virtual void SetPointSize(int pointSize
);
74 virtual void SetFamily(int family
);
75 virtual void SetStyle(int style
);
76 virtual void SetWeight(int weight
);
77 virtual bool SetFaceName(const wxString
& faceName
);
78 virtual void SetUnderlined(bool underlined
);
79 virtual void SetEncoding(wxFontEncoding encoding
);
81 // implementation only from now on
82 // -------------------------------
84 virtual bool RealizeResource();
86 // Unofficial API, don't use
87 virtual void SetNoAntiAliasing( bool noAA
= TRUE
) ;
88 virtual bool GetNoAntiAliasing() const ;
90 // Mac-specific, risks to change, don't use in portable code
92 #if wxMAC_USE_ATSU_TEXT
93 // 'old' Quickdraw accessors
94 short MacGetFontNum() const;
95 short MacGetFontSize() const;
96 wxByte
MacGetFontStyle() const;
98 // 'new' ATSUI accessors
99 wxUint32
MacGetATSUFontID() const;
100 wxUint32
MacGetATSUAdditionalQDStyles() const;
101 wxUint16
MacGetThemeFontID() const ;
103 // Returns an ATSUStyle not ATSUStyle*
105 #if wxMAC_USE_CORE_TEXT
106 const void * MacGetCTFont() const;
107 const void * MacGetCTFontDescriptor() const;
109 #if wxMAC_USE_CORE_TEXT || wxMAC_USE_ATSU_TEXT
110 void* MacGetATSUStyle() const ;
114 virtual wxGDIRefData
*CreateGDIRefData() const;
115 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
120 DECLARE_DYNAMIC_CLASS(wxFont
)
123 #endif // _WX_FONT_H_