X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1b806b98241ab649c169aaa1f134df85e80fb8b..47e175a24f862aa8b7ca7dd4a2bb5957991e7f2d:/src/osx/carbon/font.cpp diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index 643903040d..634453ec6a 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 // ---------------------------------------------------------------------------- @@ -657,7 +667,7 @@ wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const void wxFont::SetPointSize(int pointSize) { - if ( M_FONTDATA->GetPointSize() == pointSize ) + if ( M_FONTDATA != NULL && M_FONTDATA->GetPointSize() == pointSize ) return; AllocExclusive(); @@ -730,6 +740,16 @@ wxSize wxFont::GetPixelSize() const #endif } +bool wxFont::IsFixedWidth() const +{ + wxCHECK_MSG( M_FONTDATA != NULL , false, wxT("invalid font") ); + + // cast away constness otherwise lazy font resolution is not possible + const_cast(this)->RealizeResource(); + + return M_FONTDATA->IsFixedWidth(); +} + wxFontFamily wxFont::DoGetFamily() const { return M_FONTDATA->GetFamily(); @@ -1217,6 +1237,12 @@ wxFontEncoding wxNativeFontInfo::GetEncoding() const return m_encoding; } +bool wxNativeFontInfo::GetStrikethrough() const +{ + return false; +} + + // changing the font descriptor void wxNativeFontInfo::SetPointSize(int pointsize) @@ -1281,3 +1307,9 @@ void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding_) m_encoding = encoding_; // not reflected in native descriptors } + +void wxNativeFontInfo::SetStrikethrough(bool WXUNUSED(strikethrough)) +{ +} + +