]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fontcmn.cpp
implemented fallback for AlphaBlend() for the systems not supporting it
[wxWidgets.git] / src / common / fontcmn.cpp
index 9f09b4c8e188814e8f936c7ca7daa02877808329..d448cd623833a3865705efae2e7f27719f95fb39 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     20.09.99
 // RCS-ID:      $Id$
 // Copyright:   (c) wxWindows team
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -77,6 +77,33 @@ wxFont *wxFontBase::New(int size,
     return new wxFont(size, family, style, weight, underlined, face, encoding);
 }
 
+/* static */
+wxFont *wxFontBase::New(int pointSize,
+                        wxFontFamily family,
+                        int flags,
+                        const wxString& face,
+                        wxFontEncoding encoding)
+{
+    return New
+           (
+                pointSize,
+                family,
+                flags & wxFONTFLAG_ITALIC
+                    ? wxFONTSTYLE_ITALIC
+                    : flags & wxFONTFLAG_SLANT
+                        ? wxFONTSTYLE_SLANT
+                        : wxFONTSTYLE_NORMAL,
+                flags & wxFONTFLAG_LIGHT
+                    ? wxFONTWEIGHT_LIGHT
+                    : flags & wxFONTFLAG_BOLD
+                        ? wxFONTWEIGHT_BOLD
+                        : wxFONTWEIGHT_NORMAL,
+                (flags & wxFONTFLAG_UNDERLINED) != 0,
+                face,
+                encoding
+           );
+}
+
 /* static */
 wxFont *wxFontBase::New(const wxNativeFontInfo& info)
 {
@@ -117,7 +144,7 @@ wxNativeFontInfo *wxFontBase::GetNativeFontInfo() const
 #endif
 }
 
-void wxFontBase::SetNativeFontInfo(const wxNativeFontInfo& info)
+void wxFontBase::DoSetNativeFontInfo(const wxNativeFontInfo& info)
 {
 #ifdef wxNO_NATIVE_FONTINFO
     SetPointSize(info.pointSize);
@@ -296,8 +323,11 @@ bool wxNativeFontInfo::FromString(const wxString& s)
     underlined = l != 0;
 
     faceName = tokenizer.GetNextToken();
+
+#ifndef __WXMAC__
     if( !faceName )
         return FALSE;
+#endif
 
     token = tokenizer.GetNextToken();
     if ( !token.ToLong(&l) )