]>
git.saurik.com Git - wxWidgets.git/blob - src/common/fontcmn.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: common/fontcmn.cpp
3 // Purpose: implementation of wxFontBase methods
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
31 // ============================================================================
33 // ============================================================================
35 // ----------------------------------------------------------------------------
37 // ----------------------------------------------------------------------------
39 wxFontEncoding
wxFontBase::ms_encodingDefault
= wxFONTENCODING_SYSTEM
;
41 wxFont
*wxFontBase::New(int size
,
47 wxFontEncoding encoding
)
49 return new wxFont(size
, family
, style
, weight
, underlined
, face
, encoding
);
52 wxFont
& wxFont::operator=(const wxFont
& font
)
57 return (wxFont
&)*this;
60 // VZ: is it correct to compare pointers and not the contents? (FIXME)
61 bool wxFontBase::operator==(const wxFont
& font
) const
63 return m_refData
== font
.m_refData
;
66 bool wxFontBase::operator!=(const wxFont
& font
) const
68 return m_refData
!= font
.m_refData
;
71 wxString
wxFontBase::GetFamilyString() const
73 wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
75 switch ( GetFamily() )
77 case wxDECORATIVE
: return _T("wxDECORATIVE");
78 case wxROMAN
: return _T("wxROMAN");
79 case wxSCRIPT
: return _T("wxSCRIPT");
80 case wxSWISS
: return _T("wxSWISS");
81 case wxMODERN
: return _T("wxMODERN");
82 case wxTELETYPE
: return _T("wxTELETYPE");
83 default: return _T("wxDEFAULT");
87 wxString
wxFontBase::GetStyleString() const
89 wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
93 case wxNORMAL
: return _T("wxNORMAL");
94 case wxSLANT
: return _T("wxSLANT");
95 case wxITALIC
: return _T("wxITALIC");
96 default: return _T("wxDEFAULT");
100 wxString
wxFontBase::GetWeightString() const
102 wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
104 switch ( GetWeight() )
106 case wxNORMAL
: return _T("wxNORMAL");
107 case wxBOLD
: return _T("wxBOLD");
108 case wxLIGHT
: return _T("wxLIGHT");
109 default: return _T("wxDEFAULT");