X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0eb529d9e47f2591e5f49c1ba45c587341ce569e..1f361cddbfcff9c54eef6b8c447d2b93ee2825f5:/src/common/fontcmn.cpp diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index b8a4497f8b..9f09b4c8e1 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -49,6 +49,17 @@ wxFontEncoding wxFontBase::ms_encodingDefault = wxFONTENCODING_SYSTEM; +/* static */ +void wxFontBase::SetDefaultEncoding(wxFontEncoding encoding) +{ + // GetDefaultEncoding() should return something != wxFONTENCODING_DEFAULT + // and, besides, using this value here doesn't make any sense + wxCHECK_RET( encoding != wxFONTENCODING_DEFAULT, + _T("can't set default encoding to wxFONTENCODING_DEFAULT") ); + + ms_encodingDefault = encoding; +} + wxFontBase::~wxFontBase() { // this destructor is required for Darwin @@ -82,6 +93,11 @@ wxFont *wxFontBase::New(const wxString& strNativeFontDesc) return New(fontInfo); } +bool wxFontBase::IsFixedWidth() const +{ + return GetFamily() == wxFONTFAMILY_TELETYPE; +} + wxNativeFontInfo *wxFontBase::GetNativeFontInfo() const { #ifdef wxNO_NATIVE_FONTINFO @@ -459,7 +475,7 @@ wxString wxNativeFontInfo::ToUserString() const wxFontEncoding enc = GetEncoding(); if ( enc != wxFONTENCODING_DEFAULT && enc != wxFONTENCODING_SYSTEM ) { - desc << _T(' ') << wxTheFontMapper->GetEncodingName(enc); + desc << _T(' ') << wxFontMapper::Get()->GetEncodingName(enc); } #endif // wxUSE_FONTMAP @@ -512,7 +528,7 @@ bool wxNativeFontInfo::FromUserString(const wxString& s) SetPointSize(size); } #if wxUSE_FONTMAP - else if ( (encoding = wxTheFontMapper->CharsetToEncoding(token, FALSE)) + else if ( (encoding = wxFontMapper::Get()->CharsetToEncoding(token, FALSE)) != wxFONTENCODING_DEFAULT ) { SetEncoding(encoding);