]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/font.cpp
ensure that we have event loop before showing a modal dialog; this allows to do it...
[wxWidgets.git] / src / osx / carbon / font.cpp
index 2b51a315a10cf2613f7e21b2423b0b1765a20ff7..c68ff2bd84776642852ea5cb85fae8d84f43ce8d 100644 (file)
@@ -252,6 +252,9 @@ void wxFontRefData::Free()
 #endif
     m_cgFont.reset();
 #if wxOSX_USE_ATSU_TEXT
+#if wxOSX_USE_CARBON
+    m_macThemeFontID = kThemeCurrentPortFont ;
+#endif
     if ( m_macATSUStyle )
     {
         ::ATSUDisposeStyle((ATSUStyle)m_macATSUStyle);
@@ -378,7 +381,7 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size)
             if ( style & underline )
                 underlined = true ;
                 
-            m_info.Init(size,wxFONTFAMILY_DEFAULT,fontstyle,fontweight,underlined,
+            m_info.Init(fontSize,wxFONTFAMILY_DEFAULT,fontstyle,fontweight,underlined,
                 wxMacMakeStringFromPascal( qdFontName ), wxFONTENCODING_DEFAULT);
          }
     }
@@ -784,7 +787,7 @@ void * wxFont::MacGetATSUStyle() const
 #if WXWIN_COMPATIBILITY_2_8
 wxUint32 wxFont::MacGetATSUFontID() const 
 {
-    wxCHECK_MSG( M_FONTDATA != NULL , NULL, wxT("invalid font") );
+    wxCHECK_MSG( M_FONTDATA != NULL, 0, wxT("invalid font") );
 
     // cast away constness otherwise lazy font resolution is not possible
     const_cast<wxFont *>(this)->RealizeResource();
@@ -794,7 +797,7 @@ wxUint32 wxFont::MacGetATSUFontID() const
 
 wxUint32 wxFont::MacGetATSUAdditionalQDStyles() const
 {
-    wxCHECK_MSG( M_FONTDATA != NULL , NULL, wxT("invalid font") );
+    wxCHECK_MSG( M_FONTDATA != NULL, 0, wxT("invalid font") );
 
     // cast away constness otherwise lazy font resolution is not possible
     const_cast<wxFont *>(this)->RealizeResource();
@@ -1055,7 +1058,10 @@ void wxNativeFontInfo::EnsureValid()
         // ATSUFontID and FMFont are equivalent
         FMFontStyle intrinsicStyle = 0 ;
         OSStatus status = FMGetFontFromFontFamilyInstance( m_qdFontFamily , m_qdFontStyle , (FMFont*)&m_atsuFontID , &intrinsicStyle);
-        wxASSERT_MSG( status == noErr , wxT("couldn't get an ATSUFont from font family") );
+        if ( status != noErr )
+        {
+            wxFAIL_MSG( wxT("couldn't get an ATSUFont from font family") );
+        }
         m_atsuAdditionalQDStyles = m_qdFontStyle & (~intrinsicStyle );
         m_atsuFontValid = true;
     }
@@ -1303,4 +1309,4 @@ void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding_)
         encoding_ = wxFont::GetDefaultEncoding();
     m_encoding = encoding_;
     // not reflected in native descriptors
-}
\ No newline at end of file
+}