From 51b0f3719bdc32358f46bef619d1212901e18b59 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 14 Jun 2012 21:43:42 +0000 Subject: [PATCH] CoreText support for iOS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/carbon/font.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index d4a4584722..11853c8e5e 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -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(); -- 2.45.2