From ec8a8e042e32437ffbd131d87d59b0a6ce4ed453 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 18 May 2006 15:07:16 +0000 Subject: [PATCH] switching to ATS font names instead of ATSUI ones (japanese font names had problems afterwards) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/fontdlg.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mac/carbon/fontdlg.cpp b/src/mac/carbon/fontdlg.cpp index 3fab91215e..737176163d 100644 --- a/src/mac/carbon/fontdlg.cpp +++ b/src/mac/carbon/fontdlg.cpp @@ -67,14 +67,21 @@ pascal OSStatus wxMacCarbonFontPanelHandler(EventHandlerCallRef nextHandler, Eve { case kEventFontSelection : { - FMFont fontId = 0 ; + ATSUFontID fontId = 0 ; if ( cEvent.GetParameter(kEventParamATSUFontID, &fontId) == noErr ) { FMFontStyle fontStyle = cEvent.GetParameter(kEventParamFMFontStyle); FMFontSize fontSize = cEvent.GetParameter(kEventParamFMFontSize); - ByteCount actualLength = 0; CFStringRef cfName = NULL; +#if 1 + FMFontFamily fontFamily = cEvent.GetParameter(kEventParamFMFontFamily); + ATSFontFamilyRef atsfontfamilyref = FMGetATSFontFamilyRefFromFontFamily( fontFamily ) ; + OSStatus err = ATSFontFamilyGetName( atsfontfamilyref , kATSOptionFlagsDefault , &cfName ) ; + wxASSERT_MSG( err == noErr , wxT("ATSFontFamilyGetName failed") ); +#else + // we don't use the ATSU naming anymore + ByteCount actualLength = 0; char *c = NULL; OSStatus err = ATSUFindFontName(fontId , kFontFamilyName, kFontUnicodePlatform, kFontNoScriptCode, kFontNoLanguageCode , 0 , NULL , &actualLength , NULL ); @@ -102,7 +109,8 @@ pascal OSStatus wxMacCarbonFontPanelHandler(EventHandlerCallRef nextHandler, Eve } if ( c!=NULL ) free(c); - +#endif + if ( cfName!=NULL ) { fontdata.m_chosenFont.SetFaceName(wxMacCFStringHolder(cfName).AsString(wxLocale::GetSystemEncoding())); -- 2.47.2