]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/font.cpp
try to create smaller executables
[wxWidgets.git] / src / mac / font.cpp
index eec71c52eedae360d9e3ac3e1e6b585aa8b2ba28..49a96bdc56b561e987b0f8b72ac355abba94584e 100644 (file)
@@ -58,6 +58,7 @@ void wxFontRefData::Init(int pointSize,
     m_macFontSize = 0;
     m_macFontStyle = 0;
     m_fontId = 0;
+    m_noAA = FALSE;
 }
 
 wxFontRefData::~wxFontRefData()
@@ -89,6 +90,10 @@ void wxFontRefData::MacFindFont()
                                ::GetFNum( "\pMonaco" , &m_macFontNum) ;
                                break ;
                }
+               Str255 name ;
+               GetFontName( m_macFontNum , name ) ;
+               CopyPascalStringToC( name , (char*) name ) ;
+               m_faceName = (char*) name ;
        }
        else
        {
@@ -98,13 +103,9 @@ void wxFontRefData::MacFindFont()
                        m_macFontNum = ::GetAppFont() ;
                else
                {
-#if TARGET_CARBON
-                       c2pstrcpy( (StringPtr) wxBuffer, m_faceName ) ;
-#else
-                       strcpy( (char *) wxBuffer, m_faceName ) ;
-                       c2pstr( (char *) wxBuffer ) ;
-#endif
-                       ::GetFNum( (StringPtr) wxBuffer, &m_macFontNum);
+                       Str255 fontname ;
+                       wxMacStringToPascal( m_faceName , fontname ) ;
+                       ::GetFNum( fontname, &m_macFontNum);
                }
        }
 
@@ -254,6 +255,15 @@ void wxFont::SetUnderlined(bool underlined)
     RealizeResource();
 }
 
+void wxFont::SetNoAntiAliasing( bool no )
+{
+    Unshare();
+
+    M_FONTDATA->SetNoAntiAliasing( no );
+
+    RealizeResource();
+}
+
 // ----------------------------------------------------------------------------
 // accessors
 // ----------------------------------------------------------------------------
@@ -296,3 +306,8 @@ wxFontEncoding wxFont::GetEncoding() const
     return M_FONTDATA->m_encoding;
 }
 
+bool wxFont::GetNoAntiAliasing()
+{
+    return M_FONTDATA->m_noAA;
+}
+