]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/uma.cpp
corrected direction when sending events
[wxWidgets.git] / src / mac / uma.cpp
index a8f29cbbfdfe086e078213668870a7ee69599c12..9e84f4d9e95723fff5b77d5bd13afe46eac60c96 100644 (file)
@@ -106,13 +106,31 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls )
 
   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));
-       }
+    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 );
+  }
 
   long menuMgrAttr ;
   Gestalt( gestaltMenuMgrAttr , &menuMgrAttr ) ;