X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f0c8f31f407ecfce909060464c0ea655221cdab..12b5f4b4d2d8a07962da7ba3b78c8c1ec2634a67:/src/osx/carbon/gdiobj.cpp diff --git a/src/osx/carbon/gdiobj.cpp b/src/osx/carbon/gdiobj.cpp index ad33a80ba9..f768d01bea 100644 --- a/src/osx/carbon/gdiobj.cpp +++ b/src/osx/carbon/gdiobj.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/mac/carbon/gdiobj.cpp +// Name: src/osx/carbon/gdiobj.cpp // Purpose: wxGDIObject class // Author: Stefan Csomor // Modified by: @@ -20,6 +20,7 @@ #include "wx/link.h" #include "wx/osx/private.h" +#include "wx/font.h" // Linker will discard entire object file without this wxFORCE_LINK_THIS_MODULE(gdiobj) @@ -50,6 +51,9 @@ void wxStockGDIMac::OnExit() { } +extern wxFont* CreateNormalFont(); +extern wxFont* CreateSmallFont(); + const wxFont* wxStockGDIMac::GetFont(Item item) { wxFont* font = static_cast(ms_stockObject[item]); @@ -57,14 +61,31 @@ const wxFont* wxStockGDIMac::GetFont(Item item) { switch (item) { +#if wxOSX_USE_COCOA_OR_CARBON case FONT_NORMAL: font = new wxFont; +#if wxOSX_USE_ATSU_TEXT font->MacCreateFromThemeFont(kThemeSystemFont); +#else + font->MacCreateFromUIFont(kCTFontSystemFontType); +#endif break; case FONT_SMALL: font = new wxFont; +#if wxOSX_USE_ATSU_TEXT font->MacCreateFromThemeFont(kThemeSmallSystemFont); +#else + font->MacCreateFromUIFont(kCTFontSmallSystemFontType); +#endif + break; +#else + case FONT_NORMAL: + font = CreateNormalFont() ; + break; + case FONT_SMALL: + font = CreateSmallFont(); break; +#endif default: font = const_cast(super::GetFont(item)); break;