CoreText is always available on 10.5+, so using all this code unconditionally, committing Vadim's suggestions with two extensions, see #15580
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -50,11 +50,9 @@ public:
|
||||
|
||||
wxFontRefData(wxOSXSystemFont font, int size);
|
||||
|
||||
#if wxOSX_USE_CORE_TEXT
|
||||
wxFontRefData( wxUint32 coreTextFontType );
|
||||
wxFontRefData( CTFontRef font );
|
||||
wxFontRefData( CTFontDescriptorRef fontdescriptor, int size );
|
||||
#endif
|
||||
|
||||
virtual ~wxFontRefData();
|
||||
|
||||
@@ -146,9 +144,6 @@ public:
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
#if wxOSX_USE_CORE_TEXT
|
||||
// void Init( CTFontRef font );
|
||||
#endif
|
||||
public:
|
||||
bool m_fontValid;
|
||||
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
|
||||
@@ -156,9 +151,7 @@ public:
|
||||
// information here, as this speeds up and optimizes rendering
|
||||
ThemeFontID m_macThemeFontID ;
|
||||
#endif
|
||||
#if wxOSX_USE_CORE_TEXT
|
||||
wxCFRef<CTFontRef> m_ctFont;
|
||||
#endif
|
||||
#if wxOSX_USE_ATSU_TEXT
|
||||
void CreateATSUFont();
|
||||
|
||||
@@ -184,9 +177,7 @@ wxFontRefData::wxFontRefData(const wxFontRefData& data) : wxGDIRefData()
|
||||
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
|
||||
m_macThemeFontID = data.m_macThemeFontID;
|
||||
#endif
|
||||
#if wxOSX_USE_CORE_TEXT
|
||||
m_ctFont = data.m_ctFont;
|
||||
#endif
|
||||
m_cgFont = data.m_cgFont;
|
||||
#if wxOSX_USE_ATSU_TEXT
|
||||
if ( data.m_macATSUStyle != NULL )
|
||||
@@ -236,9 +227,7 @@ wxFontRefData::~wxFontRefData()
|
||||
|
||||
void wxFontRefData::Free()
|
||||
{
|
||||
#if wxOSX_USE_CORE_TEXT
|
||||
m_ctFont.reset();
|
||||
#endif
|
||||
m_cgFont.reset();
|
||||
#if wxOSX_USE_ATSU_TEXT
|
||||
#if wxOSX_USE_CARBON
|
||||
@@ -272,7 +261,6 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size)
|
||||
wxASSERT( font != wxOSX_SYSTEM_FONT_NONE );
|
||||
Init();
|
||||
|
||||
#if wxOSX_USE_CORE_TEXT
|
||||
{
|
||||
CTFontUIFontType uifont = kCTFontSystemFontType;
|
||||
switch( font )
|
||||
@@ -309,7 +297,6 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size)
|
||||
descr.reset( CTFontCopyFontDescriptor( m_ctFont ) );
|
||||
m_info.Init(descr);
|
||||
}
|
||||
#endif
|
||||
#if wxOSX_USE_ATSU_TEXT
|
||||
{
|
||||
#if !wxOSX_USE_CARBON
|
||||
@@ -464,7 +451,6 @@ void wxFontRefData::MacFindFont()
|
||||
|
||||
m_info.EnsureValid();
|
||||
|
||||
#if wxOSX_USE_CORE_TEXT
|
||||
{
|
||||
CTFontSymbolicTraits traits = 0;
|
||||
|
||||
@@ -527,8 +513,6 @@ void wxFontRefData::MacFindFont()
|
||||
|
||||
m_cgFont.reset(CTFontCopyGraphicsFont(m_ctFont, NULL));
|
||||
}
|
||||
|
||||
#endif
|
||||
#if wxOSX_USE_ATSU_TEXT
|
||||
CreateATSUFont();
|
||||
#endif
|
||||
@@ -543,12 +527,8 @@ void wxFontRefData::MacFindFont()
|
||||
|
||||
bool wxFontRefData::IsFixedWidth() const
|
||||
{
|
||||
#if wxOSX_USE_CORE_TEXT
|
||||
CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(m_ctFont);
|
||||
return (traits & kCTFontMonoSpaceTrait) != 0;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -852,8 +832,6 @@ wxUint32 wxFont::MacGetATSUAdditionalQDStyles() const
|
||||
}
|
||||
#endif
|
||||
|
||||
#if wxOSX_USE_CORE_TEXT
|
||||
|
||||
CTFontRef wxFont::OSXGetCTFont() const
|
||||
{
|
||||
wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") );
|
||||
@@ -864,8 +842,6 @@ CTFontRef wxFont::OSXGetCTFont() const
|
||||
return (CTFontRef)(M_FONTDATA->m_ctFont);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if wxOSX_USE_COCOA_OR_CARBON
|
||||
|
||||
CGFontRef wxFont::OSXGetCGFont() const
|
||||
@@ -1005,7 +981,6 @@ void wxNativeFontInfo::Init()
|
||||
m_descriptorValid = false;
|
||||
}
|
||||
|
||||
#if wxOSX_USE_CORE_TEXT
|
||||
void wxNativeFontInfo::Init(CTFontDescriptorRef descr)
|
||||
{
|
||||
Init();
|
||||
@@ -1028,7 +1003,6 @@ void wxNativeFontInfo::Init(CTFontDescriptorRef descr)
|
||||
wxCFStringRef familyName( (CFStringRef) CTFontDescriptorCopyAttribute(descr, kCTFontFamilyNameAttribute));
|
||||
m_faceName = familyName.AsString();
|
||||
}
|
||||
#endif
|
||||
|
||||
void wxNativeFontInfo::EnsureValid()
|
||||
{
|
||||
|
Reference in New Issue
Block a user