X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f8eebb9543004e8a1bf91d84d7ee38f33f977450..799690a0a9e8dd5d5d57f06d70feb19811483e70:/src/mac/carbon/uma.cpp diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index a8f29cbbfd..f6bd01f91f 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -104,20 +104,40 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls ) NavLoad() ; } - if ( TXNInitTextension != (void*) kUnresolvedCFragSymbolAddress ) - { - TXNMacOSPreferredFontDescription defaults; - defaults.fontID = kFontIDGeneva ; - defaults.pointSize = (10 << 16) ; - defaults.fontStyle = kTXNDefaultFontStyle; - defaults.encoding = kTXNSystemDefaultEncoding; - TXNInitTextension(&defaults, 1, (kTXNAlwaysUseQuickDrawTextMask | kTXNWantMoviesMask | kTXNWantSoundMask | kTXNWantGraphicsMask)); - } - 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 ; }