#include <map>
#include <string>
-IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
-
class WXDLLEXPORT wxFontRefData: public wxGDIRefData
{
public:
#define M_FONTDATA ((wxFontRefData*)m_refData)
-wxFontRefData::wxFontRefData(const wxFontRefData& data)
+wxFontRefData::wxFontRefData(const wxFontRefData& data) : wxGDIRefData()
{
Init();
m_info = data.m_info;
{
CTFontSymbolicTraits remainingTraits = traits;
const CGAffineTransform* remainingTransform = NULL;
-
+
if( remainingTraits & kCTFontItalicTrait )
{
remainingTraits &= ~kCTFontItalicTrait;
}
}
}
-
+
if ( fontWithTraits == NULL )
{
fontWithTraits = CTFontCreateWithName( wxCFStringRef(m_info.m_faceName), m_info.m_pointSize, remainingTransform );
}
-
+
}
if ( fontWithTraits != NULL )
m_ctFont.reset(fontWithTraits);
}
}
}
-
+
m_cgFont.reset(CTFontCopyGraphicsFont(m_ctFont, NULL));
}
#endif
}
-wxFontFamily wxFont::GetFamily() const
+wxFontFamily wxFont::DoGetFamily() const
{
- wxCHECK_MSG( M_FONTDATA != NULL , wxFONTFAMILY_MAX, wxT("invalid font") );
-
return M_FONTDATA->GetFamily();
}
return M_FONTDATA->m_macATSUStyle;
}
-#if WXWIN_COMPATIBILITY_2_8
wxUint32 wxFont::MacGetATSUFontID() const
{
wxCHECK_MSG( M_FONTDATA != NULL, 0, wxT("invalid font") );
}
#endif
-#endif
-
#if wxOSX_USE_CORE_TEXT
CTFontRef wxFont::OSXGetCTFont() const
UIFont* wxFont::OSXGetUIFont() const
{
wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") );
-
+
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
-
+
return (M_FONTDATA->m_uiFont);
}
const wxNativeFontInfo * wxFont::GetNativeFontInfo() const
{
wxCHECK_MSG( M_FONTDATA != NULL , NULL, wxT("invalid font") );
- wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") );
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();