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
This commit is contained in:
@@ -67,14 +67,21 @@ pascal OSStatus wxMacCarbonFontPanelHandler(EventHandlerCallRef nextHandler, Eve
|
|||||||
{
|
{
|
||||||
case kEventFontSelection :
|
case kEventFontSelection :
|
||||||
{
|
{
|
||||||
FMFont fontId = 0 ;
|
ATSUFontID fontId = 0 ;
|
||||||
if ( cEvent.GetParameter<ATSUFontID>(kEventParamATSUFontID, &fontId) == noErr )
|
if ( cEvent.GetParameter<ATSUFontID>(kEventParamATSUFontID, &fontId) == noErr )
|
||||||
{
|
{
|
||||||
FMFontStyle fontStyle = cEvent.GetParameter<FMFontStyle>(kEventParamFMFontStyle);
|
FMFontStyle fontStyle = cEvent.GetParameter<FMFontStyle>(kEventParamFMFontStyle);
|
||||||
FMFontSize fontSize = cEvent.GetParameter<FMFontSize>(kEventParamFMFontSize);
|
FMFontSize fontSize = cEvent.GetParameter<FMFontSize>(kEventParamFMFontSize);
|
||||||
|
|
||||||
ByteCount actualLength = 0;
|
|
||||||
CFStringRef cfName = NULL;
|
CFStringRef cfName = NULL;
|
||||||
|
#if 1
|
||||||
|
FMFontFamily fontFamily = cEvent.GetParameter<FMFontFamily>(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;
|
char *c = NULL;
|
||||||
OSStatus err = ATSUFindFontName(fontId , kFontFamilyName, kFontUnicodePlatform, kFontNoScriptCode,
|
OSStatus err = ATSUFindFontName(fontId , kFontFamilyName, kFontUnicodePlatform, kFontNoScriptCode,
|
||||||
kFontNoLanguageCode , 0 , NULL , &actualLength , NULL );
|
kFontNoLanguageCode , 0 , NULL , &actualLength , NULL );
|
||||||
@@ -102,6 +109,7 @@ pascal OSStatus wxMacCarbonFontPanelHandler(EventHandlerCallRef nextHandler, Eve
|
|||||||
}
|
}
|
||||||
if ( c!=NULL )
|
if ( c!=NULL )
|
||||||
free(c);
|
free(c);
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( cfName!=NULL )
|
if ( cfName!=NULL )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user