X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/99c13b276ae030a6e42097af517ad36ac7cbb648..fe6f7f3c78174df4818c9e4f12c377b9f0cc323c:/src/mac/carbon/font.cpp?ds=sidebyside diff --git a/src/mac/carbon/font.cpp b/src/mac/carbon/font.cpp index 5b7f7d684e..d069f3c89e 100644 --- a/src/mac/carbon/font.cpp +++ b/src/mac/carbon/font.cpp @@ -23,6 +23,7 @@ #include "wx/fontutil.h" #include "wx/graphics.h" +#include "wx/settings.h" #include "wx/mac/uma.h" @@ -31,6 +32,7 @@ #endif #include +#include IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) @@ -208,7 +210,7 @@ void wxFontRefData::Init(int pointSize, wxFontEncoding encoding) { m_style = style; - m_pointSize = pointSize; + m_pointSize = (pointSize == -1) ? wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize() : pointSize; m_family = family; m_style = style; m_weight = weight; @@ -413,7 +415,7 @@ void wxFontRefData::MacFindFont() // use font descriptor caching #if 1 - wxString lookupname = wxString::Format( "%s_%ld", m_faceName, traits ); + wxString lookupname = wxString::Format( "%s_%ld", m_faceName.c_str(), traits ); static std::map< std::wstring , wxCFRef< CTFontDescriptorRef > > fontdescriptorcache ; @@ -431,7 +433,7 @@ void wxFontRefData::MacFindFont() // use font caching #if 1 - wxString lookupnameWithSize = wxString::Format( "%s_%ld_%ld", m_faceName, traits, m_pointSize ); + wxString lookupnameWithSize = wxString::Format( "%s_%ld_%ld", m_faceName.c_str(), traits, m_pointSize ); static std::map< std::wstring , wxCFRef< CTFontRef > > fontcache ; m_ctFont = fontcache[ std::wstring(lookupnameWithSize.wc_str()) ];