#include "wx/osx/private.h"
-#if wxOSX_USE_ATSU_TEXT && !wxOSX_USE_CARBON
-// include themeing support
-#include <Carbon/Carbon.h>
-#endif
-
#include <map>
#include <string>
virtual ~wxFontRefData();
- void SetNoAntiAliasing( bool no = true ) { m_noAA = no; }
-
- bool GetNoAntiAliasing() const { return m_noAA; }
-
void SetPointSize( int size )
{
if( GetPointSize() != size )
#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
{
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;
void wxFontRefData::Init()
{
- m_noAA = false;
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
m_macThemeFontID = kThemeCurrentPortFont ;
#endif
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:
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
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);
M_FONTDATA->SetUnderlined( underlined );
}
-void wxFont::SetNoAntiAliasing( bool no )
-{
- AllocExclusive();
-
- M_FONTDATA->SetNoAntiAliasing( no );
-}
-
// ----------------------------------------------------------------------------
// accessors
// ----------------------------------------------------------------------------
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
CTFontDescriptorRef descriptor = NULL;
CFMutableDictionaryRef attributes;
- assert(iFamilyName != NULL);
+ wxASSERT(iFamilyName != NULL);
// Create a mutable dictionary to hold our attributes.
attributes = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
- check(attributes != NULL);
+ wxASSERT(attributes != NULL);
if (attributes != NULL) {
// Add a family name to our attributes.
// Create the traits dictionary.
symTraits = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type,
&iTraits);
- check(symTraits != NULL);
+ wxASSERT(symTraits != NULL);
if (symTraits != NULL) {
// Create a dictionary to hold our traits values.
traits = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
- check(traits != NULL);
+ wxASSERT(traits != NULL);
if (traits != NULL) {
// Add the symbolic traits value to the traits dictionary.
}
// Create the font descriptor with our attributes
descriptor = CTFontDescriptorCreateWithAttributes(attributes);
- check(descriptor != NULL);
+ wxASSERT(descriptor != NULL);
CFRelease(attributes);
}