X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9580fdc3b174375a6caf95d0b03ccd523015eaa0..77c8efc8c37da6d6a5e2e8022d21d1cd7d76371d:/src/common/fontmgrcmn.cpp?ds=sidebyside diff --git a/src/common/fontmgrcmn.cpp b/src/common/fontmgrcmn.cpp index 7d7ef9d35d..b4a379ddae 100644 --- a/src/common/fontmgrcmn.cpp +++ b/src/common/fontmgrcmn.cpp @@ -69,7 +69,7 @@ void wxFontFaceBase::Release() wxFontInstance *wxFontFaceBase::GetFontInstance(float ptSize, bool aa) { - wxASSERT_MSG( m_refCnt > 0, _T("font library not loaded!") ); + wxASSERT_MSG( m_refCnt > 0, wxT("font library not loaded!") ); for ( wxFontInstanceList::const_iterator i = m_instances->begin(); i != m_instances->end(); ++i ) @@ -103,7 +103,7 @@ wxFontFace *wxFontBundleBase::GetFace(FaceType type) const { wxFontFace *f = m_faces[type]; - wxCHECK_MSG( f, NULL, _T("no such face in font bundle") ); + wxCHECK_MSG( f, NULL, wxT("no such face in font bundle") ); f->Acquire(); @@ -115,7 +115,7 @@ wxFontBundleBase::GetFaceForFont(const wxFontMgrFontRefData& font) const { wxASSERT_MSG( font.GetFaceName().empty() || GetName().CmpNoCase(font.GetFaceName()) == 0, - _T("calling GetFaceForFont for incompatible font") ); + wxT("calling GetFaceForFont for incompatible font") ); int type = FaceType_Regular; @@ -123,8 +123,8 @@ wxFontBundleBase::GetFaceForFont(const wxFontMgrFontRefData& font) const type |= FaceType_Bold; // FIXME -- this should read "if ( font->GetStyle() == wxITALIC )", - // but since MGL neither DFB supports slant, we try to display it with - // italic face (better than nothing...) + // but since DFB doesn't support slant, we try to display it with italic + // face (better than nothing...) if ( font.GetStyle() == wxITALIC || font.GetStyle() == wxSLANT ) { if ( HasFace((FaceType)(type | FaceType_Italic)) ) @@ -141,7 +141,7 @@ wxFontBundleBase::GetFaceForFont(const wxFontMgrFontRefData& font) const return GetFace((FaceType)i); } - wxFAIL_MSG( _T("no face") ); + wxFAIL_MSG( wxT("no face") ); return NULL; } @@ -225,19 +225,15 @@ void wxFontsManagerBase::AddBundle(wxFontBundle *bundle) // ---------------------------------------------------------------------------- wxFontMgrFontRefData::wxFontMgrFontRefData(int size, - int family, - int style, - int weight, + wxFontFamily family, + wxFontStyle style, + wxFontWeight weight, bool underlined, const wxString& faceName, wxFontEncoding encoding) { - if ( family == wxDEFAULT ) - family = wxSWISS; - if ( style == wxDEFAULT ) - style = wxNORMAL; - if ( weight == wxDEFAULT ) - weight = wxNORMAL; + if ( family == wxFONTFAMILY_DEFAULT ) + family = wxFONTFAMILY_SWISS; if ( size == wxDEFAULT ) size = 12; @@ -249,8 +245,6 @@ wxFontMgrFontRefData::wxFontMgrFontRefData(int size, m_info.underlined = underlined; m_info.encoding = encoding; - m_noAA = false; - m_fontFace = NULL; m_fontBundle = NULL; m_fontValid = false; @@ -259,7 +253,6 @@ wxFontMgrFontRefData::wxFontMgrFontRefData(int size, wxFontMgrFontRefData::wxFontMgrFontRefData(const wxFontMgrFontRefData& data) { m_info = data.m_info; - m_noAA = data.m_noAA; m_fontFace = data.m_fontFace; m_fontBundle = data.m_fontBundle; @@ -285,7 +278,7 @@ wxFontMgrFontRefData::GetFontInstance(float scale, bool antialiased) const { wxConstCast(this, wxFontMgrFontRefData)->EnsureValidFont(); return m_fontFace->GetFontInstance(m_info.pointSize * scale, - antialiased && !m_noAA); + antialiased); } void wxFontMgrFontRefData::SetPointSize(int pointSize) @@ -294,21 +287,21 @@ void wxFontMgrFontRefData::SetPointSize(int pointSize) m_fontValid = false; } -void wxFontMgrFontRefData::SetFamily(int family) +void wxFontMgrFontRefData::SetFamily(wxFontFamily family) { - m_info.family = (wxFontFamily)family; + m_info.family = family; m_fontValid = false; } -void wxFontMgrFontRefData::SetStyle(int style) +void wxFontMgrFontRefData::SetStyle(wxFontStyle style) { - m_info.style = (wxFontStyle)style; + m_info.style = style; m_fontValid = false; } -void wxFontMgrFontRefData::SetWeight(int weight) +void wxFontMgrFontRefData::SetWeight(wxFontWeight weight) { - m_info.weight = (wxFontWeight)weight; + m_info.weight = weight; m_fontValid = false; } @@ -330,12 +323,6 @@ void wxFontMgrFontRefData::SetEncoding(wxFontEncoding encoding) m_fontValid = false; } -void wxFontMgrFontRefData::SetNoAntiAliasing(bool no) -{ - m_noAA = no; -} - - void wxFontMgrFontRefData::EnsureValidFont() { if ( !m_fontValid )