1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "font.h"
19 #include "wx/gdiobj.h"
21 class WXDLLEXPORT wxFont
;
23 class WXDLLEXPORT wxFontRefData
: public wxGDIRefData
25 friend class WXDLLEXPORT wxFont
;
28 wxFontRefData(const wxFontRefData
& data
);
37 /* TODO: implementation
42 #define M_FONTDATA ((wxFontRefData *)m_refData)
44 WXDLLEXPORT_DATA(extern const char*) wxEmptyString
;
47 class WXDLLEXPORT wxFont
: public wxGDIObject
49 DECLARE_DYNAMIC_CLASS(wxFont
)
52 wxFont(int pointSize
, int family
, int style
, int weight
, bool underlined
= FALSE
, const wxString
& faceName
= wxEmptyString
);
53 inline wxFont(const wxFont
& font
) { Ref(font
); }
54 inline wxFont(const wxFont
* font
) { if (font
) Ref(*font
); }
58 bool Create(int pointSize
, int family
, int style
, int weight
, bool underlined
= FALSE
, const wxString
& faceName
= wxEmptyString
);
60 virtual bool Ok() const { return (m_refData
!= NULL
) ; }
62 inline int GetPointSize() const { return M_FONTDATA
->m_pointSize
; }
63 inline int GetFamily() const { return M_FONTDATA
->m_family
; }
64 inline int GetStyle() const { return M_FONTDATA
->m_style
; }
65 inline int GetWeight() const { return M_FONTDATA
->m_weight
; }
66 wxString
GetFamilyString() const ;
67 wxString
GetFaceName() const ;
68 wxString
GetStyleString() const ;
69 wxString
GetWeightString() const ;
70 inline bool GetUnderlined() const { return M_FONTDATA
->m_underlined
; }
72 void SetPointSize(int pointSize
);
73 void SetFamily(int family
);
74 void SetStyle(int style
);
75 void SetWeight(int weight
);
76 void SetFaceName(const wxString
& faceName
);
77 void SetUnderlined(bool underlined
);
79 inline wxFont
& operator = (const wxFont
& font
) { if (*this == font
) return (*this); Ref(font
); return *this; }
80 inline bool operator == (const wxFont
& font
) { return m_refData
== font
.m_refData
; }
81 inline bool operator != (const wxFont
& font
) { return m_refData
!= font
.m_refData
; }
85 bool RealizeResource();