CoreText support for iOS

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2012-06-14 21:43:42 +00:00
parent e1875c7859
commit 51b0f3719b

View File

@@ -137,6 +137,8 @@ public:
}
wxFontEncoding GetEncoding() const { return m_info.GetEncoding(); }
bool IsFixedWidth() const;
void Free();
@@ -272,7 +274,6 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size)
Init();
#if wxOSX_USE_CORE_TEXT
if ( UMAGetSystemVersion() >= 0x1050 )
{
CTFontUIFontType uifont = kCTFontSystemFontType;
switch( font )
@@ -465,7 +466,6 @@ void wxFontRefData::MacFindFont()
m_info.EnsureValid();
#if wxOSX_USE_CORE_TEXT
if ( UMAGetSystemVersion() >= 0x1050 )
{
CTFontSymbolicTraits traits = 0;
@@ -542,6 +542,16 @@ void wxFontRefData::MacFindFont()
m_fontValid = true;
}
bool wxFontRefData::IsFixedWidth() const
{
#if wxOSX_USE_CORE_TEXT
CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(m_ctFont);
return (traits & kCTFontMonoSpaceTrait) != 0;
#else
return false;
#endif
}
// ----------------------------------------------------------------------------
// wxFont
// ----------------------------------------------------------------------------
@@ -730,6 +740,13 @@ wxSize wxFont::GetPixelSize() const
#endif
}
bool wxFont::IsFixedWidth() const
{
wxCHECK_MSG( M_FONTDATA != NULL , wxFONTWEIGHT_MAX, wxT("invalid font") );
return M_FONTDATA->IsFixedWidth();
}
wxFontFamily wxFont::DoGetFamily() const
{
return M_FONTDATA->GetFamily();