]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/font.cpp
Compilation fixes for wx{X11,GTK1,Motif} after making ref data non copyable.
[wxWidgets.git] / src / osx / carbon / font.cpp
index f53c0138caa0777ca6f728c09ccdb168b5dcc236..573f8681d0995c6a269db6c1d9b16f1d1099535e 100644 (file)
@@ -477,7 +477,7 @@ void wxFontRefData::MacFindFont()
             traits |= kCTFontItalicTrait;
 
         // use font caching
-        wxString lookupnameWithSize = wxString::Format( "%s_%ld_%ld", m_info.m_faceName.c_str(), traits, m_info.m_pointSize );
+        wxString lookupnameWithSize = wxString::Format( "%s_%u_%d", m_info.m_faceName, traits, m_info.m_pointSize );
 
         static std::map< std::wstring , wxCFRef< CTFontRef > > fontcache ;
         m_ctFont = fontcache[ std::wstring(lookupnameWithSize.wc_str()) ];
@@ -499,7 +499,7 @@ void wxFontRefData::MacFindFont()
                     {
                         CTFontSymbolicTraits remainingTraits = traits;
                         const CGAffineTransform* remainingTransform = NULL;
-                        
+
                         if( remainingTraits & kCTFontItalicTrait )
                         {
                             remainingTraits &= ~kCTFontItalicTrait;
@@ -515,19 +515,19 @@ void wxFontRefData::MacFindFont()
                                 }
                             }
                         }
-                        
+
                         if ( fontWithTraits == NULL )
                         {
                             fontWithTraits = CTFontCreateWithName( wxCFStringRef(m_info.m_faceName), m_info.m_pointSize, remainingTransform );
                         }
-                            
+
                     }
                     if ( fontWithTraits != NULL )
                         m_ctFont.reset(fontWithTraits);
                 }
             }
         }
-        
+
         m_cgFont.reset(CTFontCopyGraphicsFont(m_ctFont, NULL));
     }
 
@@ -732,10 +732,8 @@ wxSize wxFont::GetPixelSize() const
 #endif
 }
 
-wxFontFamily wxFont::GetFamily() const
+wxFontFamily wxFont::DoGetFamily() const
 {
-    wxCHECK_MSG( M_FONTDATA != NULL , wxFONTFAMILY_MAX, wxT("invalid font") );
-
     return M_FONTDATA->GetFamily();
 }
 
@@ -816,7 +814,6 @@ void * wxFont::MacGetATSUStyle() const
     return M_FONTDATA->m_macATSUStyle;
 }
 
-#if WXWIN_COMPATIBILITY_2_8
 wxUint32 wxFont::MacGetATSUFontID() const
 {
     wxCHECK_MSG( M_FONTDATA != NULL, 0, wxT("invalid font") );
@@ -838,8 +835,6 @@ wxUint32 wxFont::MacGetATSUAdditionalQDStyles() const
 }
 #endif
 
-#endif
-
 #if wxOSX_USE_CORE_TEXT
 
 CTFontRef wxFont::OSXGetCTFont() const
@@ -883,6 +878,20 @@ NSFont* wxFont::OSXGetNSFont() const
 
 #endif
 
+#if wxOSX_USE_IPHONE
+
+UIFont* wxFont::OSXGetUIFont() const
+{
+    wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") );
+
+    // cast away constness otherwise lazy font resolution is not possible
+    const_cast<wxFont *>(this)->RealizeResource();
+
+    return (M_FONTDATA->m_uiFont);
+}
+
+#endif
+
 const wxNativeFontInfo * wxFont::GetNativeFontInfo() const
 {
     wxCHECK_MSG( M_FONTDATA != NULL , NULL, wxT("invalid font") );