diff --git a/include/wx/osx/font.h b/include/wx/osx/font.h index 158df31e4d..c005e55be3 100644 --- a/include/wx/osx/font.h +++ b/include/wx/osx/font.h @@ -166,6 +166,8 @@ public: #endif protected: + virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info); + virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index fac6a43dc5..2b51a315a1 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -576,6 +576,14 @@ wxFont::~wxFont() { } +void wxFont::DoSetNativeFontInfo(const wxNativeFontInfo& info) +{ + UnRef(); + + m_refData = new wxFontRefData( info); +} + + bool wxFont::RealizeResource() { M_FONTDATA->MacFindFont(); @@ -938,7 +946,7 @@ void wxNativeFontInfo::Init() m_weight = wxFONTWEIGHT_NORMAL; m_underlined = false; m_faceName.clear(); - m_encoding = wxFONTENCODING_DEFAULT; + m_encoding = wxFont::GetDefaultEncoding(); m_descriptorValid = false; } @@ -1105,6 +1113,8 @@ void wxNativeFontInfo::Init(int size, m_weight = weight; m_underlined = underlined; m_faceName = faceName; + if ( encoding == wxFONTENCODING_DEFAULT ) + encoding = wxFont::GetDefaultEncoding(); m_encoding = encoding; } @@ -1289,6 +1299,8 @@ void wxNativeFontInfo::SetFamily(wxFontFamily family_) void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding_) { + if ( encoding_ == wxFONTENCODING_DEFAULT ) + encoding_ = wxFont::GetDefaultEncoding(); m_encoding = encoding_; // not reflected in native descriptors } \ No newline at end of file