X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..a188ac2988b6fedeead7a809124b8eaa2290c020:/src/osx/carbon/fontdlg.cpp diff --git a/src/osx/carbon/fontdlg.cpp b/src/osx/carbon/fontdlg.cpp index c61ea57612..395b13fdfb 100644 --- a/src/osx/carbon/fontdlg.cpp +++ b/src/osx/carbon/fontdlg.cpp @@ -41,6 +41,7 @@ #endif #include "wx/fontdlg.h" +#include "wx/fontutil.h" #if wxOSX_USE_EXPERIMENTAL_FONTDIALOG @@ -82,7 +83,9 @@ wxMacCarbonFontPanelHandler(EventHandlerCallRef WXUNUSED(nextHandler), if ( cEvent.GetParameter( kEventParamCTFontDescriptor, typeCTFontDescriptorRef, &descr ) == noErr ) { wxFont font; - font.MacCreateFromCTFontDescriptor(descr); + wxNativeFontInfo fontinfo; + fontinfo.Init(descr); + font.Create(fontinfo); fontdata.SetChosenFont( font ) ; setup = true; } @@ -229,8 +232,9 @@ int wxFontDialog::ShowModal() #if wxOSX_USE_CORE_TEXT if ( UMAGetSystemVersion() >= 0x1050 ) { - CTFontDescriptorRef descr = (CTFontDescriptorRef)font.MacGetCTFontDescriptor(); + CTFontDescriptorRef descr = (CTFontDescriptorRef) CTFontCopyFontDescriptor( (CTFontRef) font.OSXGetCTFont() ); err = SetFontInfoForSelection (kFontSelectionCoreTextType,1, &descr , NULL); + CFRelease( descr ); setup = true; } #endif @@ -584,7 +588,7 @@ void wxFontDialog::CreateControls() wxFontEnumerator enumerator; enumerator.EnumerateFacenames(); wxArrayString facenames = enumerator.GetFacenames(); - if (facenames) + if (!facenames.empty()) { facenames.Add(_("")); facenames.Add(_(""));