X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2f056c85d182ae6c038394cfb9f6b56df3981877..29e4a1901a9d0cd738af42f4207ae185eaf3b96e:/src/mac/carbon/uma.cpp diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index c9342a3947..f6bd01f91f 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -21,9 +21,6 @@ // windows manager, control manager, navigation services etc. are // present -#define wxUSE_MLTE 0 - - static bool sUMAHasAppearance = false ; static long sUMAAppearanceVersion = 0 ; static bool sUMAHasAquaLayout = false ; @@ -51,9 +48,8 @@ void UMACleanupToolbox() { NavUnload() ; } -#if wxUSE_MLTE - TXNTerminateTextension( ) ; -#endif + if ( TXNTerminateTextension != (void*) kUnresolvedCFragSymbolAddress ) + TXNTerminateTextension( ) ; } void UMAInitToolbox( UInt16 inMoreMastersCalls ) { @@ -108,18 +104,40 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls ) NavLoad() ; } -#if wxUSE_MLTE - TXNMacOSPreferredFontDescription defaults; - defaults.fontID = kFontIDGeneva ; - defaults.pointSize = (10 << 16) ; - defaults.fontStyle = kTXNDefaultFontStyle; - defaults.encoding = kTXNSystemDefaultEncoding; - TXNInitTextension(&defaults, 1, (kTXNAlwaysUseQuickDrawTextMask | kTXNWantMoviesMask | kTXNWantSoundMask | kTXNWantGraphicsMask)); -#endif long menuMgrAttr ; Gestalt( gestaltMenuMgrAttr , &menuMgrAttr ) ; if ( menuMgrAttr & gestaltMenuMgrAquaLayoutMask ) sUMAHasAquaLayout = true ; + + if ( TXNInitTextension != (void*) kUnresolvedCFragSymbolAddress ) + { + FontFamilyID fontId ; + Str255 fontName ; + SInt16 fontSize ; + Style fontStyle ; + GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; + GetFNum( fontName, &fontId ); + + TXNMacOSPreferredFontDescription fontDescriptions[] = + { + { fontId , (fontSize << 16) ,kTXNDefaultFontStyle, kTXNSystemDefaultEncoding } , + } ; + int noOfFontDescriptions = sizeof( fontDescriptions ) / sizeof(TXNMacOSPreferredFontDescription) ; +#if 0 // TARGET_CARBON + --noOfFontDescriptions ; +#endif + // kTXNAlwaysUseQuickDrawTextMask might be desirable because of speed increases but it crashes the app under OS X upon key stroke + OptionBits options = kTXNWantMoviesMask | kTXNWantSoundMask | kTXNWantGraphicsMask ; +#if TARGET_CARBON + if ( !UMAHasAquaLayout() ) +#endif + { + options |= kTXNAlwaysUseQuickDrawTextMask ; + } + TXNInitTextension(fontDescriptions, noOfFontDescriptions, options ); + } + + sUMASystemInitialized = true ; }