X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e587bb9ec1de95af31e7ccf1e5e0818ff752b0f..a45c9ba59b610080585f76b0d02e1f1499c96ffe:/src/osx/carbon/font.cpp?ds=sidebyside diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index 29ff06fe94..f8c6f5f347 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -28,11 +28,6 @@ #include "wx/osx/private.h" -#if wxOSX_USE_ATSU_TEXT && !wxOSX_USE_CARBON -// include themeing support -#include -#endif - #include #include @@ -66,10 +61,6 @@ public: virtual ~wxFontRefData(); - void SetNoAntiAliasing( bool no = true ) { m_noAA = no; } - - bool GetNoAntiAliasing() const { return m_noAA; } - void SetPointSize( int size ) { if( GetPointSize() != size ) @@ -159,11 +150,10 @@ protected: #if wxOSX_USE_CORE_TEXT // void Init( CTFontRef font ); #endif - bool m_noAA; // No anti-aliasing public: bool m_fontValid; #if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT - // for true themeing support we must store the correct font + // for true theming support we must store the correct font // information here, as this speeds up and optimizes rendering ThemeFontID m_macThemeFontID ; #endif @@ -189,7 +179,6 @@ wxFontRefData::wxFontRefData(const wxFontRefData& data) { Init(); m_info = data.m_info; - m_noAA = data.m_noAA; m_fontValid = data.m_fontValid; #if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT m_macThemeFontID = data.m_macThemeFontID; @@ -224,7 +213,6 @@ wxFontRefData::wxFontRefData(const wxFontRefData& data) void wxFontRefData::Init() { - m_noAA = false; #if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT m_macThemeFontID = kThemeCurrentPortFont ; #endif @@ -346,7 +334,7 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size) m_macThemeFontID = kThemeMiniSystemFont; break; case wxOSX_SYSTEM_FONT_MINI_BOLD: - // bold not available under themeing + // bold not available under theming m_macThemeFontID = kThemeMiniSystemFont; break; case wxOSX_SYSTEM_FONT_LABELS: @@ -399,6 +387,8 @@ void wxFontRefData::MacFindFont() if ( m_fontValid ) return; + wxCHECK_RET( m_info.m_pointSize > 0, wxT("Point size should not be zero.") ); + m_info.EnsureValid(); #if wxOSX_USE_CORE_TEXT @@ -477,7 +467,8 @@ void wxFontRefData::MacFindFont() WXSIZEOF(atsuTags), atsuTags, atsuSizes, atsuValues); - wxASSERT_MSG( status == noErr , wxT("couldn't modify ATSU style") ); + wxASSERT_MSG( status == noErr , wxString::Format(wxT("couldn't modify ATSU style. Status was %d"), (int) status).c_str() ); + if ( m_cgFont.get() == NULL ) { ATSFontRef fontRef = FMGetATSFontRefFromFont(m_info.m_atsuFontID); @@ -658,13 +649,6 @@ void wxFont::SetUnderlined(bool underlined) M_FONTDATA->SetUnderlined( underlined ); } -void wxFont::SetNoAntiAliasing( bool no ) -{ - AllocExclusive(); - - M_FONTDATA->SetNoAntiAliasing( no ); -} - // ---------------------------------------------------------------------------- // accessors // ---------------------------------------------------------------------------- @@ -735,13 +719,6 @@ wxFontEncoding wxFont::GetEncoding() const return M_FONTDATA->GetEncoding() ; } -bool wxFont::GetNoAntiAliasing() const -{ - wxCHECK_MSG( M_FONTDATA != NULL , false, wxT("invalid font") ); - - return M_FONTDATA->GetNoAntiAliasing(); -} - #if wxOSX_USE_ATSU_TEXT && wxOSX_USE_CARBON short wxFont::MacGetFontNum() const