X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aa6208d975c3757d75d780c661b4d7918236f4fb..71c5a4d19d8752bd54de0ef27b81cff7a6d4d5c7:/src/osx/carbon/font.cpp diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index f9b5bc90d2..dc5a0ce72f 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -209,7 +209,7 @@ wxFontRefData::wxFontRefData(const wxFontRefData& data) m_nsFont = (NSFont*) wxMacCocoaRetain(data.m_nsFont); #endif #if wxOSX_USE_IPHONE - m_uiFont = wxMacCocoaRetain(data.m_uiFont); + m_uiFont = (UIFont*) wxMacCocoaRetain(data.m_uiFont); #endif } @@ -378,7 +378,7 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size) if ( style & underline ) underlined = true ; - m_info.Init(size,wxFONTFAMILY_DEFAULT,fontstyle,fontweight,underlined, + m_info.Init(fontSize,wxFONTFAMILY_DEFAULT,fontstyle,fontweight,underlined, wxMacMakeStringFromPascal( qdFontName ), wxFONTENCODING_DEFAULT); } } @@ -576,6 +576,14 @@ wxFont::~wxFont() { } +void wxFont::DoSetNativeFontInfo(const wxNativeFontInfo& info) +{ + UnRef(); + + m_refData = new wxFontRefData( info); +} + + bool wxFont::RealizeResource() { M_FONTDATA->MacFindFont(); @@ -931,9 +939,6 @@ void wxNativeFontInfo::Init() #endif #if wxOSX_USE_COCOA m_nsFontDescriptor = NULL; -#endif -#if wxOSX_USE_IPHONE - m_uiFontDescriptor = NULL; #endif m_pointSize = 0; m_family = wxFONTFAMILY_DEFAULT; @@ -941,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; } @@ -1082,9 +1087,6 @@ void wxNativeFontInfo::Init(const wxNativeFontInfo& info) #endif #if wxOSX_USE_COCOA m_nsFontDescriptor = (NSFontDescriptor*) wxMacCocoaRetain(info.m_nsFontDescriptor); -#endif -#if wxOSX_USE_IPHONE - m_uiFontDescriptor = wxMacCocoaRetain(info.m_uiFontDescriptor);; #endif m_pointSize = info.m_pointSize; m_family = info.m_family; @@ -1111,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; } @@ -1129,10 +1133,6 @@ void wxNativeFontInfo::Free() #if wxOSX_USE_COCOA wxMacCocoaRelease(m_nsFontDescriptor); m_nsFontDescriptor = NULL; -#endif -#if wxOSX_USE_IPHONE - wxMacCocoaRelease(m_uiFontDescriptor); - m_uiFontDescriptor = NULL #endif m_descriptorValid = false; } @@ -1299,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