X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/beb2638a997914bd12c55e81589adebd90af9ed2..43c5b6e808f083617eb42cb48e77366844f8fb5c:/src/osx/carbon/font.cpp?ds=sidebyside diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index de2fbe7024..f9b5bc90d2 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -283,7 +283,7 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size) #if wxOSX_USE_CORE_TEXT if ( UMAGetSystemVersion() >= 0x1050 ) { - CTFontUIFontType uifont; + CTFontUIFontType uifont = kCTFontSystemFontType; switch( font ) { case wxOSX_SYSTEM_FONT_NORMAL: @@ -323,7 +323,7 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size) { #if !wxOSX_USE_CARBON // not needed outside - ThemeFontID m_macThemeFontID; + ThemeFontID m_macThemeFontID = kThemeSystemFont; #endif switch( font ) { @@ -384,10 +384,10 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size) } #endif #if wxOSX_USE_COCOA - m_nsFont = wxFont::CreateNSFont( font, &m_info ); + m_nsFont = wxFont::OSXCreateNSFont( font, &m_info ); #endif #if wxOSX_USE_IPHONE - m_uiFont = wxFont::CreateUIFont( font, &m_info ); + m_uiFont = wxFont::OSXCreateUIFont( font, &m_info ); #endif } @@ -483,10 +483,10 @@ void wxFontRefData::MacFindFont() } #endif #if wxOSX_USE_COCOA - m_nsFont = wxFont::CreateNSFont( &m_info ); + m_nsFont = wxFont::OSXCreateNSFont( &m_info ); #endif #if wxOSX_USE_IPHONE - m_uiFont = wxFont::CreateUIFont( &m_info ); + m_uiFont = wxFont::OSXCreateUIFont( &m_info ); #endif m_fontValid = true; } @@ -772,11 +772,34 @@ void * wxFont::MacGetATSUStyle() const return M_FONTDATA->m_macATSUStyle; } + +#if WXWIN_COMPATIBILITY_2_8 +wxUint32 wxFont::MacGetATSUFontID() const +{ + wxCHECK_MSG( M_FONTDATA != NULL , NULL, wxT("invalid font") ); + + // cast away constness otherwise lazy font resolution is not possible + const_cast(this)->RealizeResource(); + + return M_FONTDATA->m_info.m_atsuFontID; +} + +wxUint32 wxFont::MacGetATSUAdditionalQDStyles() const +{ + wxCHECK_MSG( M_FONTDATA != NULL , NULL, wxT("invalid font") ); + + // cast away constness otherwise lazy font resolution is not possible + const_cast(this)->RealizeResource(); + + return M_FONTDATA->m_info.m_atsuAdditionalQDStyles; +} +#endif + #endif #if wxOSX_USE_CORE_TEXT -CTFontRef wxFont::GetCTFont() const +CTFontRef wxFont::OSXGetCTFont() const { wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") ); @@ -790,7 +813,7 @@ CTFontRef wxFont::GetCTFont() const #if wxOSX_USE_COCOA_OR_CARBON -CGFontRef wxFont::GetCGFont() const +CGFontRef wxFont::OSXGetCGFont() const { wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") ); @@ -805,7 +828,7 @@ CGFontRef wxFont::GetCGFont() const #if wxOSX_USE_COCOA -NSFont* wxFont::GetNSFont() const +NSFont* wxFont::OSXGetNSFont() const { wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") ); @@ -1034,7 +1057,7 @@ void wxNativeFontInfo::EnsureValid() #endif #if wxOSX_USE_COCOA if ( m_nsFontDescriptor == NULL ) - ValidateNSFontDescriptor(); + OSXValidateNSFontDescriptor(); #endif #if wxOSX_USE_IPHONE // TODO